In the original uSystemLibrary only has the Random; method. And for some reason was missing its overloaded version Random(ARange: integer): Integer;
So I updated the uSystemLibrary to include the Random(ARange: integer): integer;.
What I did was the updated the uSystemLibrary.pas with the following:
- Edit Line 254 to the following:
DefineMethod( 'Random', 1, tkVariant, nil, RandomProc, false, 1, 'ARange: integer' );
- Then starting at Line 783, I updated the RandomProc to be the following:
procedure TatSystemLibrary.RandomProc(AMachine:TatVirtualMachine);
begin
with AMachine do
begin
case InputArgCount of
0: ReturnOutputArg( Random );
1: ReturnOutPutArg( Random( GetInputArgAsInteger(0) ) );
end;
end;
end;
If you edit the uSystemLibrary.pas file with the above. You will now be able to use the Random and Random(ARange: Integer) methods.