Is it not possible to use Random method in Console Application in Delphi? It won't compile and shows the error:
'.' expected but '(' found
When I try to do the same thing in normal application (with windows), it works.
The whole code I'm trying to compile is here:
program random;
{$APPTYPE CONSOLE}
uses SysUtils;
var iRan:integer;
begin
Randomize;
iRan:=Random(10);
writeln(iRan);
readln;
end.
Your program is named random
. That name hides that name in System
.
Either use a different program name or fully qualify the function, System.Random
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With