xPL Language Extensions

The xPL class provides xPL-specific extensions to VBScript, and can be used from any of your scripts when running under xPLHal.
The following xPL-specific functions are currently available:

To retrieve a specific parameter from an xPL message

xpl.getparam(<message>,<parameter>,<strip white space>)
The body of the xPL message will be searched for a matching parameter value.
e.g. myparam = xpl.getparam(xplMessage,"housecode",True)

You can specify the following special parameters to retrieve other portions of the message:
{SCHEMA} will return the message schema, e.g. x10.basic
{MSGTYPE} will return the type of message, e.g. xpl-trig

To enumerate all parameters in an xPL Message

xpl.GetParamCount()
Returns the number of parameters contained within the body of the message.

xpl.GetParamName(<XplMsg>,<index>)
Returns the name of the parameter at the specified index.

xpl.GetParamValue(<XplMsg>,<index>)
Returns the value of the parameter at the specified index.

To send an xPL message

xpl.sendmsg(<message type>,<target>,<Schema>,<message body>)
e.g. mymsg=mymsg+"speech=hello world"+chr(10)
     mymsg=mymsg+"voice=buffy"+chr(10)
     call xpl.sendmsg("","","TTS.ANNOUNCE",mymsg)
The body message should only contain the name/value pairs, the final chr(10) is optional
A <message type> of "" defaults to "XPL-CMND"
A <target> of "" defaults to "*"

To safely get the <source_instance>

xpl.srcinst("<source>_<instance>")
e.g. who = xpl.srcinst("<Source>_<Instance>")
Safely sets who to <source>.<instance>
Should only be required where source is xpl. or sys. or x10.