.MAYBEOUTPUT

Synopsis

(special form)

.MAYBEOUTPUT value
Description

Works like OUTPUT except that the expression that provides the input value might not output a value, in which case the effect is like STOP. This is intended for use in control structure definitions, for cases in which you don't know whether some expression produces a value.

.MAYBEOUTPUT is an alternative to RUNRESULT. It's fast and easy to use, at the cost of being an exception to FMSLogo's evaluation rules. (Ordinarily, it should be an error if the expression that's supposed to provide an input to something doesn't have a value.)

Example
TO INVOKE :procedure [:inputs] 2
  .MAYBEOUTPUT APPLY :procedure :inputs
END

(INVOKE "PRINT "a "b "c)
a b c

PRINT (INVOKE "WORD "a "b "c)
abc

SourceForge.net Logo