Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Testing a string in if statement (http://www.alice.org/community/showthread.php?t=8324)

Julien 04-07-2012 01:26 PM

Testing a string in if statement
 
How do I test in an if statement ...

if (parameter== string)

if (direction=="forward") . I am trying to do this within a custom walk procedure, (Alice 3.0). It seems i can only test for integer or real number, or boolean.

Thanks...

MrMoke 04-08-2012 07:48 PM

Easy
 
1) Create two String Variables in World.
2) Drag an if statement into myFirstWorld, set to true.
3) Drag one of your String variables into the true field. You will be presented with "==" and "!=" options. Select the "==", then expressions, and finally the name of the second variable.


All times are GMT -5. The time now is 10:37 AM.

Copyright ©2021, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.