Open Sage

Discussion Topics => Sage 100 => Documentation => Topic started by: John Spikowski on November 15, 2017, 09:24:21 PM

Title: ProvideX.Script (PVXCOM)
Post by: John Spikowski on November 15, 2017, 09:24:21 PM
Six methods are available for use with ProvideX.Script:
Three properties are also associated with the interface:

Instance - Returns a unique string to identify the server during its lifetime.

State - Returns the state of the server: 0 (zero) - Uninitialized; 1 - Initialized.

Parameter - Read/write property used to access the specified PxPlus parameter.


Additional Properties

To create an object within the OLE Server, the method NewObject is used. It returns an object identifier to the ProvideX object that was created. Along with the ProvideX defined properties and methods, the OLE server adds the following properties:

Instance - Returns a unique identifier of the ProvideX.Script object that was used to create the automation object. This is important because the automation object cannot be passed to another ProvideX.Script server.

ScriptObject - Returns the parent ProvideX.Script object.

CmdHandle - Returns the ProvideX handle to which the automation object is tied.


Naming Conventions

Be aware that COM is generally data-type insensitive; i.e. it does not support the $ or % suffix. This can cause a problem when dealing with ProvideX via the OLE Server, since in ProvideX, you can have Cust_no$ and Cust_no (as two unique data variables).

To avoid this issue, the OLE Server mandates that all property references indicate the property type in the first character of the property name:

s - For string variables

n - For numeric variables

i - For integer variables

o - For object variables (required)


Example:
Code: [Select]
Cat$ becomes sCat, Dog becomes nDog , and Pig% becomes iPig.

These prefixes are only for use by programs using the OLE Server, not by the ProvideX application itself. This means that the property Cust_no$ in ProvideX would be sCust_no when referenced by the OLE Server, and the property Cust_no in PxPlus would be nCust_no, etc.

Note:  Do not use these prefixes in the property definition. Use of the o prefix allows the specification of properties and/or methods within ProvideX objects to be declared themselves as objects.