declaration
function RandomRange(const AFrom, ATo: Integer): Integer;
description
Returns a random integer number from a given range.
To initialize the random number generator, call (once) the Randomize procedure.
example
var r: integer;
Randomize;
r := RandomRange(-4, 5);
// r would be an integer where -4 < r < 5
Har gjordt sådan
procedure TForm1.Button1Click(Sender: TObject);
var
r: integer;
begin
Randomize;
r := RandomRange(-4, 5);
// r would be an integer where -4 < r < 5
end;
Men hvor skal man declare den function ?