When I try to use WriteFile or WriteLnFile I get:
- Run-time error (OnCommand): Access violation at address 00403EC2 in module 'soldatserver.exe'
I'm using WriteFile on a script I'm working on.
I tried it in a simple procedure (that is called through OnCommand) just to make sure and it stills crashes.
procedure test(Text: string);
begin
WriteLnFile('test.txt', Text);
end;
function OnCommand(ID: Byte; Text: string): boolean;
begin
if (Text = '/test') then test('just testing!');
Return := false
end;
It works, "just testing" is written to test.txt, but after that I get the Run-time error.
I had a lot of trouble with GetPiece in this version too. In 2.5.4 the index started at 1, in the new version it seems to start at zero. I was in a hurry so I didn't test it very much, but it was giving me a headache so I used the split function instead.
Can anyone test the WriteFile and WriteLnFile functions and report if it works for you?
Thanks.