Generating a random number within a range

I’m trying to generate a random number within a range of 1-1023. Is there anyway this can be done in MBasic as easily as in other languages?

From the Atom Pro manual:

[code]a var long
MyRand var word
a = random TCA

(code using the value of a)
loop
a = random a ; uses “aâ€