Function Calls And Passing Parameters - Maple Systems Silver Series Installation And Operation Manual

Operator interface terminal
Hide thumbs Also See for Silver Series:
Table of Contents

Advertisement

Mac ros
Format
For counter = start To/Down end [Step
steps ]
[Statements]
Next [counter]
While – Wend statement
Loop an unknown number of times. Looping is controlled by the Condition. When Condition is TRUE, the
statements will be executed repetitively until the condition turns to FALSE.
Condition
Necessary. An expression which evaluates to TRUE or FALSE.
Statements
Optional. Statement block.
break
Used in looping control or select statement. It skips immediately to the end of the statement.
continue
Used in looping control statement. It quits the current iteration of a loop and starts the next one.
return
Returns to the function or module that called the current function.
Format
While [Condition]
[Statements]
Wend
Boolean ex pres sions:
The value of Boolean expression is zero means FALSE.
The value of Boolean expression is not zero means TRUE.

Function calls and passing parameters

A sub-function must be defined before its execution and is therefore placed before the main() macro function. If
there is an entry attempt into a function before it is first defined in the macro program will create a compiler error
'Function not defined'.
Sub int SQR(int x)
number
x = x * x
return x
Examples
For n = 100 Down 0 Step 3
n = n * 2
Next n
For loop = 0 To 20 Step 2
loop = (loop + 1) *2
Next loop
Examples
For n = 100 Down 0 Step 3
n = n * 2
Next n
For loop = 0 To 20 Step 2
loop = (loop + 1) *2
Next loop
//This is the sub-function that squares a
255
1010-1001a, Rev 02

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents