Torque script post increment bug (%i++)
by Terence Tan · in Torque Game Engine · 11/12/2006 (5:16 am) · 1 replies
This is probably a known Torque script bug or quirk but here goes anyways:
Code 1:
Code 2:
Both these piece of code should do the same thing but they don't. Code 1 increments the value before passing it to addRow. Code 2 is what i did to fix it. As I said, probably a known quirk. Not sure how well Torque script pre-increments.
Code 1:
profileList.addRow(%i++, getProfileDisplayName(%file) @ "\t" @ %file );
Code 2:
profileList.addRow(%i, getProfileDisplayName(%file) @ "\t" @ %file ); %i++;
Both these piece of code should do the same thing but they don't. Code 1 increments the value before passing it to addRow. Code 2 is what i did to fix it. As I said, probably a known quirk. Not sure how well Torque script pre-increments.
About the author
Torque Owner Gary "ChunkyKs" Briggs
Gary (-;