RPC HELP TMult

From VistApedia
Jump to: navigation, search

RPC Broker Help Home

TMult Class

Applies to

TRPCB Unit

Description

The TMult class is used whenever a list of multiple values needs to be passed to a remote procedure call (RPC) in a single parameter. The Mult property of a parameter is of TMult type. The information put in the TMult variable is really stored in a TStringList, but the access methods (used to read and write) take strings as subscripts and provide the illusion of a string-subscripted array.

It’s important to note that items in a TMult class may or may not be sorted. If the Sorted property is False (default), then the elements will be stored in the order they are added. If Sorted is True, items will be stored in ascending alphabetical order by subscripts.

If you attempt to reference an element by a nonexistent subscript you will get an error in form of a Delphi exception. Don’t forget that M syntax dictates that all strings must be surrounded by double quotes. So, if your goal is to pass a string subscripted array of strings using TMult as a parameter to an RPC on the VistA M Server, don’t forget to surround each of the subscripts and their associated values with double quotes ("). Otherwise, M will assume that you’re passing a list of variables and will attempt to reference them, which is probably not what you want.