animpos -> switch expression not integral???
Posted:
Tue May 10, 2011 10:58 am
by sonicfire
- Code: Select all
switch (myactor.animpos)
{
case 0:
// do this
break;
case 1:
// do that
break;
}
error: switch expression not integral? huh?
animpos is integer, right ?
Re: animpos -> switch expression not integral???
Posted:
Tue May 10, 2011 11:36 am
by sonicfire
thanks!!
this is something i never understood -> that cast thing.
so, animpos is NOT integer? but with (int) i force switch to interpret animpos as integer?
Re: animpos -> switch expression not integral???
Posted:
Tue May 10, 2011 7:22 pm
by savvy
no, animpos is an integer. otherwise you couldn't set it on a textNumber. its just that in switch you need to tell it that its an integer.
otherwise it reads it as some random obscure thing which it doesnt know.