Welcome, Guest
Username: Password: Remember me
General discussions, feature requests for CodeTyphon Project and discussions that don't fit in any of the other specific CodeTyphon forum categories.
  • Page:
  • 1

TOPIC:

Random() NOT random 8 years 8 months ago #8059

  • Tigr
  • Tigr's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 54
  • Thank you received: 1
Every time you start the program, the sequence number generation the same, - is not good :(
...............


procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
s:string;
begin
for i :=1 to 100 do
begin
s:=s+inttostr(random(10));
end;
memo1.Lines.add(s);
end;

Please Log in or Create an account to join the conversation.

Random() NOT random 8 years 8 months ago #8060

  • gulyone
  • gulyone's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 99
  • Thank you received: 5
Program test;

begin
Randomize; // Sets the RandSeed Global variable to GetTickCount64 so the random number generator is initialized
...
RequireDerivedFormResource:=True;
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;

end.

Please Log in or Create an account to join the conversation.

Last edit: by gulyone.

Random() NOT random 8 years 8 months ago #8061

  • Tigr
  • Tigr's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 54
  • Thank you received: 1
thanks

Please Log in or Create an account to join the conversation.

  • Page:
  • 1