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 Discussion / mod command

Author
Message
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 25th Dec 2003 23:22 Edited at: 25th Dec 2003 23:42
what is the mod command for DB? for QBasic it is MOD, for JAVA it is %, but i dont know what it is for DB.

i need to know because i need to know if the mouse is over a certain tile. so if i do

thus making mx always divisable by 10 (right? maybe it needs a bit of tweeking, but thats the general idea)
thanx for any help

something grand i just found out, it aint mod nor %
but in this post http://darkbasicpro.thegamecreators.com/?m=forum_view&t=19921&b=7
someone said that it was just MOD, but i assume it was only for DBPro, because i cant seem to get it to work, it gives me a "unknown command" error if i use MOD

Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 26th Dec 2003 02:21
Yup, I'm afraid that the MOD command is only for DBPro.

But, you can make a simple function.



Hope I Helped...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 26th Dec 2003 06:07
oh, cool, when you put EndFunction r it returns r as the value? i didnt know that, that is the nicest thing i'v learned today!

John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 26th Dec 2003 07:04
Yep, you return a variable with Endfunction


Dont forget to Join the Forums!
Hell IVIonkey
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 26th Dec 2003 07:28
Here's one that I use that removes the need for loops:



Login to post a reply

Server time is: 2025-05-22 08:51:50
Your offset time is: 2025-05-22 08:51:50