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.

DarkBASIC Professional Discussion / Is it possible to use a RND command in a function

Author
Message
rolo9
16
Years of Service
User Offline
Joined: 1st Jan 2010
Location:
Posted: 22nd Jul 2012 02:59
I tried to make a function using the rnd command inside the function and keep getting a parser error. It did not matter if I put a variable or an actual number inside the function. I tried passing it an int variable and no luck. it looked like this:

function Ronran(a)
rnd(a)
endfunction a

any help would be appriciated. thanx, rolo9
Kezzla
17
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 22nd Jul 2012 03:15
You have forgotten to send the random number to a variable

try


That will work for you

Sometimes I like to use words out of contents
Daniel wright 2311
User Banned
Posted: 22nd Jul 2012 03:18 Edited at: 22nd Jul 2012 03:19
Or how about this,Your not giving any kind of command at all



my signature keeps being erased by a mod So this is my new signature.
rolo9
16
Years of Service
User Offline
Joined: 1st Jan 2010
Location:
Posted: 22nd Jul 2012 04:44
Thank you thank you thank you. This will save alot of codeing.

Login to post a reply

Server time is: 2026-07-07 12:28:25
Your offset time is: 2026-07-07 12:28:25