• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Need help making a QBasic program

yellowperil

Diamond Member
I know, I know, it's QBasic. But that's the only programming language(?) I vaguely remember and I have to write a 8-page paper by tomorrow morning, so I can't bother to learn anything else. Plus it's the only programming software I have (on the WinME CD).

I'm trying to generate a random 10-digit number to be displayed for 3 seconds. I also need to generate a random 10-digit number in this format: XXX-XXX-XXXX, also for 3 seconds. I'm not sure where to begin other than RANDOMIZE TIMER. I'm using the help file to re-learn all the keywords but I'd appreciate any help on this. Thanks 🙂
 
RANDOMIZE TIMER will start to seeding the Random Number Generator with the time variable.

the function you are looking for is RND() just use it like X=RND
and X will have a random value between 0 and 1. I think it's single precision, so it's probably have 5-7 places after decimal. in order
to generate a 10 digit number, you might need to do it 2-3 times, and add them to form a 10 digits number, say X=INT(RND*1000) will give you a value between 0 and 999.

hope this helps.. my QB is crummy as well.
 
Back
Top