The CALL statement transfers control to a BASIC subprogram or other callable routine. You can pass optional arguments to the routine and can specify how these arguments are to be passed. When the called routine finishes executing, control returns to the calling program. Example CALL SUB1 BY REF (A$, Z BY VALUE, D$() BY DESC)
1 – Syntax
CALL routine [ pass-mech ] [ ( [ actual-param ],... ) ] routine: { sub-name } { any callable routine } pass-mech: { BY REF } { BY VALUE } { BY DESC } actual-param: { exp } { array ( [,]... ) } [ pass-mech ] }
2 – Passing mechanisms
The term "parameter passing mechanism" refers to the way in which data is passed to a subprogram. BASIC supports three parameter passing mechanisms with the following BY clauses: BY VALUE, BY REF, and BY DESC. By default, BASIC passes and receives scalar numeric data by reference, and strings and arrays by descriptor. All BASIC FUNCTION and SUB subprograms receive parameters BY REF or BY DESC. If a program consists entirely of BASIC program modules, you should not specify any parameter passing mechanism. However, other programming languages may not pass or receive parameters in the same way. You may have to specify a parameter passing mechanism when calling non-BASIC programs.