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

Years of Service
User Offline
Joined: 13th Jan 2013
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
Most Awesome Blog!
Mr Bigglesworth
Years of Service
User Offline
Joined: 4th Mar 2008
Posted: 24th Jan 2013 00:23

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.

Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
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: 2023-12-05 06:19:17
Your offset time is: 2023-12-05 06:19:17