Using binary conditions as a part of a Test Box

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using binary conditions as a part of a Test Box

Offray Vladimir Luna Cárdenas
Hi all,

There is a way to put two condition as a part of a Test Box in a Etoys
script. We can add more operant to a condition, but all the operators
are aritmetic ones: "+", "-", "*", "//", and "\\" but there is a way to
create a Test condition with "and" or "or"?

I don't know if I made myself clear enough.


Cheers,

Offray
_______________________________________________
Squeakland mailing list
[hidden email]
http://squeakland.org/mailman/listinfo/squeakland
Reply | Threaded
Open this post in threaded view
|

Re: Using binary conditions as a part of a Test Box

Scott Wallace
Hi, Offray!

For the present, one has to use *nested* Test Boxes to achieve the  
effect of the "ands" and "ors" you want.

Thus, where you want, for example

   TEST ((elmer's x < 5) and (elmer's y < 5))
          YES  elmer make sound croak

this could be constructed as:

TEST  elmer's x < 5
   YES   TEST elmer's y < 5
            YES   elmer make sound croak

or (to explicate my shorthand):


pastedGraphic.tiff (61K) Download Attachment