Passing Control Properties

Some control properties that appear to be strings are actually variants and cannot be passed directly to an API function. For example:

piut_setservernode(Text1.caption)

gives a type mismatch error.

To avoid this you can explicitly convert to a string:

piut_setservernode(cStr(Text1.caption))

or copy into an intermediate string variable.

Dim server as string

server = Text1.caption

piut_setservernode(server)

This applies whenever a variant is passed whether it is from a control, an object, or a locally declared variable.

Enabling Operational Intelligence