CALL


Statement to invoke a subroutine

Syntax:
Call procname ([parameter list])

Description:
Calls a Sub or Function.

This keyword is a holdover from earlier dialects of BASIC, and is mainly deprecated.

In -lang qb, it can be used to call subs in code before they are declared. The function will be implicitly Declare'd, with any parameters passed Byref As Any.
Note: until the function is declared, no type-checking is done on the parameters, so it is up to the programmer to ensure they are of the correct type.

Examples:
'' Compile with -lang qb or -lang fblite

#lang "fblite"

Declare Sub foobar(ByVal x As Integer, ByVal y As Integer)
Call foobar(35, 42)

Sub foobar(ByVal x As Integer, ByVal y As Integer)
Print x; y
End Sub


'' Compile with -lang qb or -lang fblite

#lang "fblite"

Function f ( ) As Integer
f = 42
End Function

Call f ' execute function f, but ignore the answer


'' Compile with -lang qb

'$lang: "qb"

Call mysub(15, 16) '' call "mysub" before it has been declared, or even mentioned.

Sub mysub(ByRef a As Integer, ByRef b As Integer)
   
    Print a, b
   
End Sub


Dialect Differences:
Differences from QB:
See also:
Back to Procedures
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode