animpos -> switch expression not integral???

Non-platform specific questions.

animpos -> switch expression not integral???

Postby sonicfire » Tue May 10, 2011 10:58 am

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 ? :shock:
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score

Re: animpos -> switch expression not integral???

Postby rykein » Tue May 10, 2011 11:19 am

Code: Select all
switch ((int)myactor.animpos)
{
case 0:
// do this
break;
case 1:
// do that
break;
}
rykein
 
Posts: 63
Joined: Mon Jul 26, 2010 7:26 am
Score: 6 Give a positive score

Re: animpos -> switch expression not integral???

Postby sonicfire » Tue May 10, 2011 11:36 am

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?
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score

Re: animpos -> switch expression not integral???

Postby savvy » Tue May 10, 2011 7:22 pm

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.
--> For my help, i ask for a simple +1 if it helps! ^-^
--> I dont code, I type art which you dont understand.
--> I keep winning the 3D model challenge at college, teacher says: "you keep winning im not giving you prizes".
User avatar
savvy
 
Posts: 494
Joined: Wed Jun 03, 2009 11:55 am
Location: England
Score: 44 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest