OLE control methods

A method is a command that is sent to an OLE control. Each method has a name, and is called as a function from within Sculptor.

SYNTAX

ole_ctrl_id->”method_name” (arg1 [, arg2]…)

If the method returns a value, this value can be used in the usual way.

EXAMPLE

!function evCalMethod(EventCode, Object) {
     if (EventCode != EV_BUTTON_CLICKED) return
     switch (Object) {
          case ?= bNextDay:
               oleCal->"NextDay"()
               break
          case ?= bPrevDay:
               oleCal->"PreviousDay"()
               break
          ...
     }

Sculptor supports complex property and method references, such as the following:

ole_ctrl_id->”property1“->”method_name”(arg)->”property2

EXAMPLE

oleIconImageList->"ListImages"->"Add"(1, "Icon1", \
     load_picture("$SCULPTOR\\IMAGES\\KEYS.ICO"))

If a temporary field is supplied as a parameter, the OLE control receives that parameter by reference. If the control changes the value or uses the parameter to return a value, the value of the temporary field is changed in the Sculptor program.

Some OLE methods have optional parameters. If there is no value to be passed by the program to such a parameter, then the value NULL must be sent instead. This indicates that the default value for that parameter should be used. The following examples illustrate this:

  1. Use default value for first parameter.

    ole_ctrl_id->”method_name” (NULL, 10, -1)

  2. Use supplied value for first parameter.

    ole_ctrl_id->”method_name” (20, 10, -1)


RELATED TOPICS

OLE controls