DECLARE SUB Fixed
DECLARE SUB NotFixed
CREATE Form AS QFORM
CREATE Button1 AS QBUTTON
Align = 1
CAPTION = "Fixed seed (always the same sequence)"
OnClick = Fixed
END CREATE
CREATE Box AS QRICHEDIT
Align = 5
Font.Name = "Courier New"
HideSelection = 0
END CREATE
CREATE Button2 AS QBUTTON
Align = 2
CAPTION = "TIMER as seed (Varied sequence IF different Second)"
OnClick = NotFixed
END CREATE
Center
SHOWMODAL
END CREATE
SUB Fixed
RANDOMIZE 123456
A$ = ""
FOR A& = 1 TO 10
A$ = A$ + STR$(RND(100)) + " "
NEXT
Box.AddStrings A$
END SUB
SUB NotFixed
RANDOMIZE TIMER
A$ = ""
FOR A& = 1 TO 10
A$ = A$ + STR$(RND(100)) + " "
NEXT
Box.AddStrings A$
END SUB
|