I assume you mean "I only get modified values for x and y after Jump finishes but I want to see the values as they are changed." If that is what you mean then NXC is not for you. There are no real reference types available in the standard firmware. NXC pretends to support reference types by passing back out of the function the values of the local variables used inside the function and updating the variables passed in with those local variable values after the function call completes. If you want to modify a global variable that is shared across multiple threads then just use those global variables directly rather than trying to pass them into a function via reference parameters. NXC has always worked this way and will not be changing so long as it generates code that runs on the NXT firmware.nxtboyiii wrote: But this only returns x and y at the end of the function.Code: Select all
void Jump(int & sx, int & sy) { repeat(5) { sx++; sy++; } }
I have to ask, what exactly did you mean by
The word "anymore" is what has me so puzzled. If it used to work differently than it does now can you point me to a compiler version and/or firmware version where it behaved the way you think it worked previously? How do you think this used to behave?Using a void like this doesn't work anymore
John Hansen