Define Square(X)  a simple function
Return X^2;
EndDefine;
Square(3);
9

Define IsPrime(X)  a more complicated function
If Type(X) <> INT Then Return Error("Expected INT") EndIf;
I := 2;
While I^2 <= X Do
If Mod(X, I) = 0 Then Return False EndIf;
I := I+1;
EndWhile;
Return TRUE;
EndDefine;  end of function definition
IsPrime(4);
FALSE

Define Test(A, B)  a function with two arguments
Sum := A+B;
Prod := A*B;
PrintLn "The sum of ", A," and ", B," is ", Sum,".";
Print "The product of ", A," and ", B," is ", Prod,".";
EndDefine;
Test(3,5);
The sum of 3 and 5 is 8.
The product of 3 and 5 is 15.

