Arno Garrels wrote:
>>
>>If the Index is not zero-based (starts with 1), then it should be 6,
>>otherwise you'd get '=AUTH' or ' AUTH'.  
> 
> 
> But S is _not_ an array, it is a String type.
> At index 0 of a String you have the length. 
> 

Right, so then the Index argument starts at 1 to mark the first 
character.  That means that if you start with:
        S := '250-AUTH=LOGIN CRAM-MD5 PLAIN';

and then do:
        Delete(S, 1, 4);

you are left with:
        S := 'AUTH=LOGIN CRAM-MD5 PLAIN';

So now, if you do:
        S := Copy(S, 5, Length(S));

then you get:
        S := '=LOGIN CRAM-MD5 PLAIN';

Because it started copying at the 5th character, no?

This is why Stéphane mentioned that the Index should be changed to a 6. 
  I think you thought he was talking about the 5 in the third argument of
        if (CompareText(Copy(S, 1, 5), 'AUTH ') = 0) or

Instead of the 5 in the second argument of
        S := Copy(S, 5, Length(S));

        dZ.


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to