I have encountered a compiler glitch[PascalScript]... this is not a one of the bugs were it points to the wrong line either.
Alright heres my code:
Simba Code:
procedure updateFiles;
var
tsa:TStringArray;
i:Integer;
begin
tsa := Getfiles(AppPath + 'dir\', 'txt');
myGUI.loaded.ITEMS.Clear;
for i := 0 to high(tsa) do
myGUI.loaded.ITEMS.Add(replace(tsa[i], '.txt', '', [rfReplaceAll]));
end;
I'm getting invalid number of parameters at this line:
Simba Code:
myGUI.loaded.ITEMS.Add(replace(tsa[i], '.txt', '', [rfReplaceAll]));
So... as you can see replace returns a string thus it should have the correct number of parameters. But maybe the replace could have the wrong number? So I broke it down:
Simba Code:
procedure updateFiles;
var
tsa:TStringArray;
i:Integer;
str:String;
begin
tsa := Getfiles(AppPath + 'dir\', 'txt');
myGUI.loaded.ITEMS.Clear;
for i := 0 to high(tsa) do
begin
str := replace(tsa[i], '.txt', '', [rfReplaceAll]);
myGUI.loaded.ITEMS.Add(str);
end;
end;
Turns out it thinks the replace function has invalid number of parameters (as when I comment it out it compiles)
I don't get it:
Parameters for replace:

Code:
Replace(text, find, replace, flags);
text = tsa[i]
find = '.txt'
replace = ''
flags = [rfReplaceAll]
The only reasoning here is that the compiler is glitched. I copied and pasted this exact code from another program:
Simba Code:
myBoard.loaded.ITEMS.Add(replace(tsa[i], '.txt', '', [rfReplaceAll]));
except I changed myBoard to myGUI