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[S] Statement (Non-Basic Procedures) Details
◄Summary► ◄Details► ◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
Syntax 1: For Non-Array Arguments
CALL name [([[{BYVAL|SEG}] argument] [,[{BYVAL|SEG}] argument])]...
CALLS name [argument] [,argument]...
Syntax 2: For Array Arguments
CALL name [([argument[()]] [, argument[()]])]...
name [argument[()]] [, 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.
■ CALLS is the same as using CALL with a SEG keyword before each argument;
every argument in a CALLS statement is passed as a segmented address.
■ If name refers to an assembly-language procedure, it must be a name
declared with PUBLIC (symbol).
■ The result of the BYVAL keyword differs from Visual Basic's pass by
value:
CALL Difference (BYVAL A,(B))
For the first argument, only the value of A is passed to Difference. In
contrast, (B) is evaluated, a temporary location is created for the
value, and the address of the temporary location is passed to
Difference.
■ You can use Visual Basic's pass by value for an argument, but the
procedure in the other language must accept an address, because the
address of the temporary location is passed.
■ Be careful using the SEG keyword to pass elements of arrays because
Visual Basic may move arrays in memory before the called routine starts
to execute. Anything in an argument list that causes memory movement may
create problems. You can safely pass variables using SEG if the
argument list for the CALL statement contains only simple variables,
arithmetic expressions, or arrays indexed without the use of intrinsic
or defined functions.