The information in this article applies to:
SUMMARY
When calling a SUBprogram in QuickBasic without the keyword "CALL" (by
specifying just the SUB name and arguments), you must omit the
parentheses around the parameter list. This is known as an "implied
CALL" statement. You must also declare that procedure in a DECLARE
statement.
MORE INFORMATIONThe normal form of the CALL statement is as follows:
In the above example, arg1 and arg2 are passed "by reference." Passing
"by reference" means that if the subprogram changes the values of the
passed parameters, they are passed back changed.
If an individual parameter is placed inside parentheses, the parameter is passed "by value":
Passing a variable "by value" means that only its value is passed, and
the value of the variable in the calling program is not changed by
assignments in the SUBprogram.
If the CALL statement is omitted from the line (i.e., only the SUB name is given to indicate the CALL), then the outermost parentheses must be omitted. The proper syntax for a call by reference without the CALL keyword is as follows:
The proper syntax for a call by value without the CALL keyword is as
follows:
The following is an example of the difference between calling by
reference and by value:
Additional query words: QuickBas BasicCom
Keywords : |
Last Reviewed: December 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |