Call Subroutine Method
The Call Subroutine method is a control structure that directs flow to a subroutine or function. It returns one of the following values:
If it calls a function, then it returns the output of the function.
if it calls a subroutine, then it returns nothing.
You can use this method to call a subroutine or function that is written in Visual Basic or to call C code in a DLL. A Declare Procedure method must describe this C code and it must be implicit in the application. You must make sure the DLL is present on every Siebel Server. For more information, see Declare Procedure Method.
If you use the Call Subroutine method, then it is recommended that you use the following guidelines:
Format A
Call subroutine_name [(argument_list)]
subroutine_name argument_list
where:
subroutine_name is the name of the subroutine or function. Siebel VB passes control to this subroutine or function.
Arguments
The following table describes the arguments that you can use with this method.
Argument | Description |
---|---|
argument_list |
The arguments that Siebel VB passes to the subroutine or function. |
Example
The following example does the following:
Calls a subroutine named CreateFile to open a file.
Writes the numbers 1 through 10 in this file.
The calling code examines the file mode, and then closes the file if the mode is 1 or 2:
(general) (declarations)
Option Explicit
Declare Sub CreateFile
Sub CreateFile
Rem Put the numbers 1-10 into a file
Dim x as Integer
Open "c:\temp001" for Output as #1
For x = 1 to 10
Write #1, x
Next x
End Sub
Sub Button1_Click
Dim filemode as Integer
Dim attrib as Integer
Call CreateFile
attrib = 1
filemode = FileAttr(1,attrib)
If filemode = 1 or filemode = 2 then
Close #1
End If
Kill "c:\temp001"
End Sub