Arbortext IsoDraw > Macro Language Reference > Functions and Data Types > Functions > Return
  
Return
Parameters can be passed down to macros or subMacros using a return function.
SUBMACRO Fact( Integer n )
#Calculates the factorial "n!"
DEFINE prod AS integer
DEFINE i AS integer
prod = 1
FOR i = 1 TO n
prod = prod*i
END FOR
RETURN prod
END SUBMACRO

MACRO Calculate Factorial
DEFINE n AS integer
DEFINE result AS integer
n = Get integer "Please enter a small integer value"
n = abs(n)
result = Run Fact(n)
MESSAGE n+"! = " + result
END MACRO