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 >
Text File  |  1990-06-11  |  894b  |  21 lines

  1. if  -- Command or operation, two or three inputs.
  2.      The first input to the if procedure must be either the  word  true  or
  3.      the  word  false.   Typically, it is the output from a predicate.  The
  4.      second and (optional) third inputs are  lists  containing  instruction
  5.      lines.   The second input is executed if the first input is true.  The
  6.      third input, if any, is executed if the first input is false:
  7.  
  8.      to greet :person
  9.      if equalp :person [Ronald Reagan] [print [Hi, turkey!]] \
  10.                          [print sentence "Hi, :person]
  11.      end
  12.  
  13.      In that example, the first input to if is the output from the  expres-
  14.      sion
  15.      equalp :person [Ronald Reagan].
  16.  
  17.      The if procedure can be used as an operation, producing a  value.   In
  18.      this case, the third input is required:
  19.  
  20.      print if equalp :person "Reagan ["Loser] ["Winner]
  21.