definning paramerters and variables suggestion -
10-14-2006, 11:56 AM
I know that Alice is now in the hands of EA sports, but could who ever knows how to contact EA sports, mention to them that parameters and variables include the difference between float, integer values? I already had two incidents so far when Alice returned a parameter false becuase the parameter was an integer and the check condition was a float.
for example.
I got an event that says this
When anykey is typed,
do sphere.speak whichKey=code
the method sphere.speak looks like this
parameters whichKeyCode
if whichKeyCode == 38 then
sphere say the upArrow key was pressed
else
nothing
now when I originally did this, the parameter whichKey was 38. However the if statement was checking it like this...
if 38 == 38.0
these are totally two different types of varibles. The "38" is a integer, and the "38.0" is a float. In addition, even if you put the round function in front of the value 38.0 it still reads as 38.0 which causes the if statement to always be false, and this is annoying.
|