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 / A question on the "INC" command (and related commands)

Author
Message
Marsekay
16
Years of Service
User Offline
Joined: 24th May 2008
Location:
Posted: 30th May 2008 00:27
Before i found INC i would use (assuming we are using "x" as our variable) x=x+1 etc rather than INC x

What is the difference? as they are both controllable.

is there a speed difference?

Marse
Deego
16
Years of Service
User Offline
Joined: 21st May 2008
Location:
Posted: 30th May 2008 10:35 Edited at: 30th May 2008 10:50
INC x,n adds n to x to create a new value of x. x=x+n also does the same thing. I think INC is easier to use when you set linear integer variables (like x = number of enemies killed), and x=x(any functions) for calculating things that increase or decrease non-linearly.

Not sure about any speed difference though, but I think it'll depend more on what the changing variable is doing in the program than how n is added to x. I'm curious to know as well. Maybe try this.



and



Run them and time which one ends faster? Is this silly enough to work? Not with this code literally, but with some sort of advanced tomfoolery...

Login to post a reply

Server time is: 2024-11-15 19:52:40
Your offset time is: 2024-11-15 19:52:40