9.0

111
Call Instruction
Syntax
Call name[(arglist)]
-or-
name
[arglist]
Group
Flow Control
Description
Evaluate the arglist and call subroutine (or function) name with those values. Sub (or function) name must be
previously defined by either a Sub
, Function or Property definition. If name is a function then the result is discarded.
If Call is omitted then name
must be a subroutine and the arglist is not enclosed in parens.
See Also: Declare
, Sub.
Example
Sub Show(Title$,Value)
Debug
.Print Title$;"=";Value
End
Sub
C:\ABCTemp\vbs\Sub_Definition.htm
Sub
Main
Call Show("2000/9",2000/9) ' 222.2222222222
Show "1<2",1<2 'True
End
Sub
CallByName Instruction
Syntax
CallByName(Obj,ProcName,CallType,[expr[, ...]])
Group
Flow Control
Description
Call an Obj's method/property, ProcName, by name. Pass the exprs to the method/property.
Parameter Description
Obj Call the method/property for this object reference.
ProcName This string value is the name of the method/property to be called.
CallType Type of method/property call. See table below.
expr These expressions are passed to the obj's method/property.
CallType Value Effect
vbMethod 1 Call or evaluate the method.
vbGet 2 Evaluate the property's value.
vbLet 4 Assign the property's value.