Method Call Syntax
In simple cases, method calls have the following syntax:
[<object name>.]<method name> ([<parameter 1> [,<parameter 2>...]])
Note that parentheses () are mandatory in method calls.
This is the name of the object, which is the context of the method, as it can be obtained in the Object Activator.
Object names in method calls cannot contain spaces. Use an underscore (_) instead of a space. If you use the Object Activator to compose method calls, this happens automatically.
For example, the Object Activator will display an inserted instance of the MyBrowser web browser control as:
If you inserted the browser control on a tab page, the object name will look like:
This is the name of the method you want to call.
Use the Object Activator to find out about methods exposed by objects. First click the object in the Object Browser pane. The methods the object exposes are now listed on the Methods tab page. Methods exposed by all objects are on the Application Methods tab page.
For example, the Microsoft Web Browser control exposes a Navigate method that allows you to tell it that it should browse to a web page. You can call this method by writing
Properties are a special case of methods. You can get a property value by calling the property without parameters. You can (re)set the value of a property by calling the property with a value:
Many methods expect one or more parameter values when they are called.
For example, the Navigate method of the Microsoft Web Browser control expects a URL (Universal Resource Locator) string as a parameter value. If you want to design a button that makes the web browser go to the USoft web site, compose the following method call as the value of the button's Action property:
Strings are surrounded by single quotes as shown in this example. The Object Activator automatically quotes strings. Embedded single quotes must be written as two separate, consecutive single quotes:
When a parameter is not surrounded by single quotes, USoft will assume that it is an embedded method call which produces a string output. The string output will then function as the string parameter of the main method call. For example:
To find out about expected mandatory or optional parameters, use USoft reference documentation for native methods and third-party object-specific documentation for methods of ActiveX objects.