[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: TML Pascal II Random Number
I have an answer for myself, but not sure whether this is the best
solution for TML Pascal. Any suggestion appreciated.
I found that the Random function is actually provided by QuickDraw,
and it also has a SetRandSeed function. So I use the GetTick function
in the MiscTool and do this:
SetRandSeed(GetTick)
x := abs(Random);
This will give me a number between 0 to 32768, but then I have to
divide down to the range that I really wanted. Looks like a hardway to
do something simple, but is there a better method?