Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Randomizing certain numbers

Author
Message
Dot Merix
21
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Canada
Posted: 3rd Nov 2004 07:27 Edited at: 3rd Nov 2004 07:40
Hey guys, this is probably one of the most stupid questions ever.. but i'm having troubles randomizing a cell on each loop from 1 to 4.

Help would be appreciated

ie.. x = rnd(4)

I need the cell x to be randomized from 1 to 4.

[EDIT] This post can be deleted or left.. I figured it out..

My old code was shown above would return 0 to 4, so i tried..
x = rnd((3)+1) however that also would go from 0 to 4

It was because i didnt place the + 1 outside the main bracket, so the new working and proper code is; x = rnd(3)+1



WindowsXP Home(Service pack 2), Athlon XP 2400+(2.1Ghz), 1GIG Ram, Ati Radeon 9800Pro 128MB.
IanG
20
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 6th Nov 2004 04:06
try

and remeber to add the randomize timer command to make them truly random

Used to be Phoenix_insane registered in september 2003 despite what the date says to the left <--
PC - amd athlon 2, 512mb, force 0 8mb, 0gb, p sp2

Login to post a reply

Server time is: 2024-11-27 15:55:37
Your offset time is: 2024-11-27 15:55:37