| **Navigation:**  [[introduction.htm|Language Reference]] > 13 - Built-in Functions >====== RANDOM (return random number) ====== | [[quotereplacestring special characters .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[records return number of rows in data set .htm|{{btn_next_n.gif|Next page}}]] | | || **RANDOM(**//low//,//high//**)** {{blk2blue.jpg|blk2blue.jpg}} | **RANDOM** | Returns random integer. | | //low// | A numeric constant, variable, or expression for the lower boundary of the range. | | //high// | A numeric constant, variable, or expression for the upper boundary of the range. | The **RANDOM** procedure returns a random integer between the //low// and //high// values, inclusively. The //low// and //high// parameters may be any numeric expression, but only their integer portion is used for the inclusive range. **Return Data Type:     **LONG **Example:** **Num                BYTE,DIM(49)** **LottoNbr           BYTE,DIM(6)** ** CODE** ** CLEAR(Num)** ** CLEAR(LottoNbr)** ** LOOP X# = 1 TO 6** **  LottoNbr[X#] = RANDOM(1,49)    !Pick numbers for Lotto** **  IF NOT Num[LottoNbr[X#]]** **   Num[LottoNbr[X#]] = 1** **  ELSE** **   X# -= 1** **  END** ** END**