home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
d
/
doslogo.zip
/
LOGOHLP.ZIP
/
IF.HLP
< prev
next >
Wrap
Text File
|
1990-06-11
|
894b
|
21 lines
if -- Command or operation, two or three inputs.
The first input to the if procedure must be either the word true or
the word false. Typically, it is the output from a predicate. The
second and (optional) third inputs are lists containing instruction
lines. The second input is executed if the first input is true. The
third input, if any, is executed if the first input is false:
to greet :person
if equalp :person [Ronald Reagan] [print [Hi, turkey!]] \
[print sentence "Hi, :person]
end
In that example, the first input to if is the output from the expres-
sion
equalp :person [Ronald Reagan].
The if procedure can be used as an operation, producing a value. In
this case, the third input is required:
print if equalp :person "Reagan ["Loser] ["Winner]