PARAMETER

From Smart Box
Revision as of 19:31, 6 October 2023 by Benryves (talk | contribs) (Created page with "== Syntax == PARAMETER variable,variable,variable... == Description == The PARAMETER command assigns values to variables in a procedure. Any number of values can be ‘passed’ to the procedure in this way. It is like performing a number of LET commands at once. == Example == First type in this procedure ''sum'': PARAMETER number1,number2,number3 PRINT "Add together "; PRINT number1;"+";number2;"+";number3 PRINT "= "; PRINT number1+number2+number3 Now fr...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Syntax[edit]

PARAMETER variable,variable,variable...

Description[edit]

The PARAMETER command assigns values to variables in a procedure. Any number of values can be ‘passed’ to the procedure in this way. It is like performing a number of LET commands at once.

Example[edit]

First type in this procedure sum:

PARAMETER number1,number2,number3
PRINT "Add together ";
PRINT number1;"+";number2;"+";number3
PRINT "= ";
PRINT number1+number2+number3

Now from the main screen call the procedure by typing

sum 1,2,3 <Enter>

The screen will display

Add together 1+2+3
= 6

Associated keywords[edit]