advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
CALL Statement (Basic Procedures) Details
  Summary  Details  Example                Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
 Syntax 1:
 CALL name [([BYVAL] argument, [BYVAL] argument...)]
 
 Syntax 2:
 name [[BYVAL] argument, [BYVAL] argument...]
 
 Usage Notes
   ■ The CALL keyword is optional when you use the CALL statement. When you
     omit CALL, you must declare the procedure in a DECLARE statement. If you
     dont't, when you save the program, Visual Basic automatically generates
     a DECLARE statement for you. When you omit CALL, you must omit the
     parentheses around the argument list.
 
   ■ If you omit the CALL keyword, you cannot follow the procedure name with
     a colon (:), the Visual Basic statement-separation character. If you do,
     Visual Basic treats the procedure name as a label instead of a call to
     the procedure.
 
   ■ The CALL statement passes arguments by reference or by value, depending
     on how the argument is defined in the DECLARE or SUB statement.
     See: By Reference Vs. By Value
 
   ■ Within the CALL statement, the BYVAL keyword is informational. An
     argument must be defined as being passed by value in the procedure, or
     in the DECLARE statement for the procedure to pass that argument by
     value. For example:
 
         DECLARE SUB Mult(BYVAL X!, Y!)
         .
         .
         .
         CALL Mult (BYVAL X!, Y!)
 
     BYVAL in the CALL statement is optional; deleting it has no effect.
     Adding BYVAL to Y! in the CALL statement without changing the DECLARE
     statement generates an error. See: BYVAL Clause