
Originally Posted by
Kieran x Dzr
Hi mate, thanks for the reply, I read that and honestly coulnd't understand how I could use it. I'm not that good at this.. I need the code to take a .txt file that literally has two columns in it and then store those, then be able to move down 1 line and get me the next one
So learn..
Untested:
Simba Code:
var
i: Integer;
hFile: Integer;
pSize: Integer;
pString: String;
pStringArray: TStringArray;
pUserInfo: TStringArray;
begin
hFile := OpenFile('C:/Simba/Scripts/Login.txt', false);
if ((hFile <> -1) and ReadFileString(hFile, pString, FileSize(hFile)) then
begin
pStringArray := Explode(#13, pString);
for i := 0 to high(pStringArray) do
begin
pUserInfo := Explode(' ', pStringArray[i]);
writeln('Username: ', pUserInfo[0], 'Password: ', pUserInfo[1]);
end;
end;
CloseFile(hFile);
end;