how would i append or load a text file that contains a list into an array
Simba Code:TSA := [TextFile];
TSA := ['item1','item2','item3'];
Text file:
item1
item2
item3
Printable View
how would i append or load a text file that contains a list into an array
Simba Code:TSA := [TextFile];
TSA := ['item1','item2','item3'];
Text file:
item1
item2
item3
I'm unfamiliar with parsing files in PascalScript, but I assuming you want to load settings for your script?
In that case, you can use this tutorial.
Simba Code:var
n: Integer;
str: string;
TSA: TStringArray;
begin
n := OpenFile('C:\Simba\textfile.txt', true);
ReadFileString(n, str, FileSize(n));
CloseFile(n);
// seperates each element in the result TSA by delimeter = ', '
ExplodeWrap(', ', str, TSA);
end.
* Be careful about new lines, I think you might have to box a char value to handle those.
i need to load a wordlist so its kinda confusing for me
how would i handle new lines?
its just reading them all as one index :(
Try this for newlines:
Simba Code:ExplodeWrap(#13#10, str, TSA);
Sweeet Thanks!!