[Back to GSN Home Page] [Back to Message Index]

Global SchoolNet - Automated Message Archive

LOGO-L> IF and IFELSE




Michael Tempel (michaelt@media.mit.edu)
Sat, 16 Sep 95 11:09:04 -0400

Bill Kerr suggests that Keith Gum's IF needs to be changed
to IFELSE:

>To correct :response
>if equalp :response :Answer
> [pr [that's right!]]
> [pr[wrong]]
>end
>
>As well as the correction that
>Michael has pointed out I think
>you will need an ifelse, instead
>of an if.
>
>ie. ifelse equal?
> first :response :answer
> [pr "yes][pr "no]

That depends on the version of Logo. Bill is correct for
LogoWriter. But I think Keith is using an older version of
Logo, maybe Apple Logo II. (Keith: What version of Logo
are you using?) In that case IF can be used with or without
the last input.

IF <condition>
<stuff to do if true>

or

IF <condition>
<stuff to do if true>
<stuff to do if false>

In LogoWriter (and MicroWorlds), the second version would
use IFELSE.

--------------------------------------------------
Michael Tempel Tel: 212 765 4918
Logo Foundation FAX: 212 765 4789
250 West 57th Street
New York, NY 10107-2228
---------------------------------------------------------------
Please post messages to the Logo forum to logo-l@gsn.org. Mail
questions about the list administration to logofdn@gsn.org. To
unsubscribe send unsubscribe logo-l to majordomo@gsn.org.