BYOND Version: 411.976
Operating System: Windows XP
Web Browser: Firefox
Game/Hub(s): Dream Maker
Descriptive Problem Summary:
When using the ++ operator on a variable, without doing anything else to it, will yield the following: "warning: variable defined but not used". yet it is used in the following statement.
Code Snippet (if applicable) to Reproduce Problem:
var/hello=0
hello++ //Adds 1 to hello.
// hello :warning: variable defined but not used
Expected Results:
For no warning to display.
Actual Results:
A warning displays telling me hello has no effect.
Does the problem occur:
Every time? Or how often? Yes
Workarounds:
var/hello=0
hello+=1 //Also ads 1 to hello but does not give an error.
Please correct me if I'm wrong, but isn't this the use of the ++ operator?
The problem is that you're doing stuff to the variable, yes, but you're not then using the variable anywhere else. Consider, for example:
Much as you're doing operations on 'useless', you're not actually using it for anything.