Hello,

I want to know if it is possible to use the RANDOM function under a limited range.

Let me explain :

I want to use the RANDOM function and the BRANCH to make 39 differents things (branch to 39 differents labels to execute differents functions).

There is the code

RANDOM result
BRANCH result,[state1, state2, state3, state4,...,state39]

This is equivalent to do this
If result=0 go to state1 subroutine
if result=1 go to state2 subroutine
...

The RANDOM function give me 0 to 65535 results, how can I limit it to 0-38 for my 39 states ??

thanks for your help!

Martin