Argument Types in Method Calls

Previous Next

See Also

Arguments are values you assign to properties, or parameter values you pass when calling methods. Arguments can be simple text-like values (strings), or they can be object-like. For example, an object-like value could represent a window, not its name but the runtime window itself.

USoft built-in properties and method parameters are always of type String, even if values represent numbers or dates. USoft user-defined properties may be of type String (the default) but also of an object-like type. Embedded ActiveX objects may of course expose any type of method or property, and you need their documentation to find out.

The Object Activator allows you to pass both text-like and object-like arguments to another window in the Create() method call that opens that window. The arguments must correspond to user-defined properties in the other window. This feature enables you to customize interaction between runtime windows.

To provide text-like parameters in the Object Activator, first click on the parameter node in the Script box, then click Edit, and type the parameter value. If the expected value is a text string, the Object Activator will automatically put single quotes around your input. A SQL statement acting as a parameter for the SqlScript() method is not surrounded by quotes.

Generally, object-like values are automatically converted to text-like values if used in a context where a string is expected. In this case USoft column objects are automatically converted to the on-screen value they currently hold. Likewise, USoft Label objects are automatically converted to the label text they currently have.

If ActiveX objects are bound to USoft columns, then USoft makes sure that automatic conversion to the current value occurs.

Example

You have inserted an ActiveX calendar control as a base column control for a DATE column in a USoft application. In the Object Browser, the calendar control is shown as a subnode of the USoft column control. For USoft, the calendar control is just a source for DATE values.

In a calendar control, you can click a month, a day and a year. Whatever is the default format in which the calendar control serves data is also the format to which USoft converts the value. You can influence formatting by setting the USoft Default Bind property of the column control to a specific value. This should not normally be necessary if the ActiveX column is well designed.