I have the following code scan through a file, CashSpot.txt. Spot should be -1 if your name is not in there, but if it is, then Spot will = the number of lines down you are where as the first line is 0.
File := XSplit(ReadFile('CashSpot.txt'),chr(10) + chr(13));
Spot := -1;
i := 0
while (i <> Spot) and (i <= ArrayHigh(File)) do begin
if Copy(File,1,Length(IDtoName(ID))) = IDtoName(ID) then Spot := i;
i := i + 1;
end;
It works with 0 or 1 person in the list, but not 2 for some reason. Please help.