Game Development Community

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:
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.

#1
11/12/2006 (12:49 pm)
Torquescript doesn't postincrement. %var++ is a preincrement operator

Gary (-;