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.

Dark GDK / I need help using dbRND to draw a line

Author
Message
skeeterz71
6
Years of Service
User Offline
Joined: 13th Jan 2013
Location:
Posted: 21st Jan 2013 19:32
Here is what I need to do, and how far I have gotten with the code. I am stuck with how to incorporate dbRND into the code. FYI. I'm new to coding, DarkGDK, C++ etc. So my terminology grasp is still somewhat limited

If someone could help me out I would appreciate it. Of course I could be way off base here as well



Over 40 & Back to School
http://www.SkeeterZ71.com
Most Awesome Blog!
Mr Bigglesworth
11
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 24th Jan 2013 00:23
Hello

To use dbRnd, you need to give it an integer from which to randomize numbers. For this, I would use a value of 100 to start and see how the program works.

BMacZero
13
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ N_America/ USA/ CA/ South
Posted: 6th Feb 2013 06:42
To clarify, the parameter for dbRnd sets a limit on the random number returned. So dbRnd(100) returns a number from 1 to 100 (or maybe 0 to 99, I don't remember).

A wise man once told me you shouldn't use any of the db functions if an equivalent alternative exists in C or C++. They tend to be much slower. In this case, it's probably better to use rand from <cstdlib>.

Login to post a reply

Server time is: 2019-11-12 19:25:51
Your offset time is: 2019-11-12 19:25:51