Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Testing a string in if statement
Old
Julien
Junior Member
 
Status: Offline
Posts: 6
Join Date: Jan 2012
Default Testing a string in if statement - 04-07-2012, 01:26 PM

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...
   
Reply With Quote
Easy
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Default Easy - 04-08-2012, 07:48 PM

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.

Last edited by MrMoke; 04-08-2012 at 07:53 PM.
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



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