As an addition to my post regarding arrays, here are other bugs I have come across that EnEsCe blatantly ignores in IRC.
The newer socket stuff bombs if a connection cannot be obtained. The manual states that ConnectSocket will set its third parameter to something less than 1 if the tcp connection fails. It does indeed set the variable, but the failed socket creation creates a run-time error that breaks the funciton ConnectSocket was called in, preventing any further code from being executed. The following code will reach the WriteLn if connection is successful, but execution of ActivateServer will terminate if the connection fails. Also, OnException receives no notice of this error (actually, it seems to me that OnException never gets called for anything).
var
ip: string;
port: word;
sock_id: integer;
procedure ActivateServer();
begin
ip := '127.0.0.1';
port := 1020;
ConnectSocket(ip, port, sock_id);
WriteLn('Result of connect: ' + inttostr(sock_id));
end;
Another issue is with the 'with' statement of Pascal. The following code runs fine with the comment left as-is, which is expected. However, uncommenting the code results in internal errors, even though the code is perfectly valid Pascal.
type
Player = record
username: string;
score: integer;
end;
var
first: Player;
procedure ActivateServer();
begin;
with first do begin
{
username := 'that guy';
score := 0;
}
end;
end;
You can tell me that "the 'with' statement isn't supported in Soldat scripting", but that's just lazy programmer cop-out. Stop breaking the language! There's a point where a person gets sick of hearing "that's been disabled" and "we don't support that feature of Pascal". Especially when it has to do with core language elements like arrays and 'with'. Yes I'm on a programming rampage, but I think I'm done now.