Function NextPosWord (S : ShortString; InitPos, Mode : Byte) : Byte;
Var
I : Integer;
Begin
InitPos := Min (Max (InitPos, 1), Length(S));
if Mode = mdDescend Then
I := -1
else
I := 1;
while ((InitPos <= Length(S)) And (InitPos > 0) And (S[InitPos] <> ' ')) Do
Inc (InitPos, I);
while ((InitPos <= Length(S)) And (InitPos > 0) And (S[InitPos] = ' ')) Do
Inc (InitPos, I);
if InitPos > Length (S) Then
InitPos := 0;
NextPosWord := InitPos;
End;
Assinar:
Postar comentários (Atom)
Nenhum comentário:
Postar um comentário