I would like to be able to do this, but for some reason the compiler keeps throwing a syntax error:
Probably because the +1 on the end.
See, I can do this in any other language except for this one for some reason unless I am doing it wrong? Maybe I need parenthesis? I am afraid if I put it in parenthesis that it would actually increment the variable by 1 instead of "referencing as it is plus 1"
The PlayerIndex is 0 based, and the label I want 1 based. So if PlayerIndex is 0, I want the user to see "1" hence why I put the + 1 on the end.
I really dont want to have to declare another variable and add another line of code if I dont have to.
any ideas?
B4X:
lblPlayer2.Text = "No player in Slot: " & PlayerIndex + 1
Probably because the +1 on the end.
See, I can do this in any other language except for this one for some reason unless I am doing it wrong? Maybe I need parenthesis? I am afraid if I put it in parenthesis that it would actually increment the variable by 1 instead of "referencing as it is plus 1"
The PlayerIndex is 0 based, and the label I want 1 based. So if PlayerIndex is 0, I want the user to see "1" hence why I put the + 1 on the end.
I really dont want to have to declare another variable and add another line of code if I dont have to.
any ideas?