bas7advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
RANDOMIZE Statement Details
  ◄Syntax►  ◄Details►  ◄Example►                 ◄Contents►  ◄Index►  ◄Back►
──────────────────────────────────────────────────────────────────────────────
RANDOMIZE initializes (reseeds) the random-number generator using expression%.
 
RANDOMIZE [expression%]
    ■ If you omit expression%, BASIC pauses and asks for a value by printing
      the following message before executing the RANDOMIZE statement:
        Random Number Seed (-32768 to 32767)?
 
    ■ When you use the argument expression%, BASIC uses this value to
      initialize the random-number generator.
 
Usage Notes
    ■ If the random-number generator is not reseeded, the RND function
      returns the same sequence of random numbers each time the program
      is run. To avoid this, place a RANDOMIZE statement at the beginning
      of the program and change the argument with each run.
    ■ A convenient way to initialize the random-number generator is to use
      the TIMER function. Using TIMER ensures a new series of random numbers
      each time you use the program.