Difference between revisions of "RPC HELP TParamRecord PType Property"

From VistApedia
Jump to: navigation, search
 
Line 2: Line 2:
 
[[RPC_HELP_TParamRecord_PType_Property_Example|Example]]
 
[[RPC_HELP_TParamRecord_PType_Property_Example|Example]]
  
Applies to
+
<h3>Applies to</h3>
[[RPC_HELP_TParamRecord|TParamRecord]] class
+
    [[RPC_HELP_TParamRecord|TParamRecord]] class
 
 
 
<h3>Declaration</h3>
 
<h3>Declaration</h3>
     <code>property PType: [[RPC_HELP_TParamType|TParamType]];</code>
+
     property PType: [[RPC_HELP_TParamType|TParamType]];
 +
    ('''PType''' is a property of the [[RPC_HELP_TParamRecord|TParamRecord]] used in the Param property.)
 
 
 
<h3>Description</h3>
 
<h3>Description</h3>
    <code>('''PType''' is a property of the [[RPC_HELP_TParamRecord|TParamRecord]] used in the Param property.)</code>
 
 
 
The '''PType''' design-time property determines how the parameter will be interpreted and handled by the Broker.
 
The '''PType''' design-time property determines how the parameter will be interpreted and handled by the Broker.
*'''Value Definition'''
+
 
** literal -- The VistA M Server receives the contents of the corresponding [[RPC_HELP_TParamRecord_Value_Property|Value]] property as one string or one number.
+
'''Value -- Definition'''
reference The VistA M Server receives the contents of the corresponding [[RPC_HELP_TParamRecord_Value_Property|Value]] property as a name of a variable defined on the server. Using indirection, the Broker on the server will resolve this parameter before handing it off to the application.
+
* '''literal''' -- The VistA M Server receives the contents of the corresponding [[RPC_HELP_TParamRecord_Value_Property|Value]] property as one string or one number.
list This value is used whenever an application wants to send a list of values to the VistA M Server. In this case, the contents of the corresponding [[RPC_HELP_TParamRecord_Mult_Property|Mult]] property is sent, while the [[RPC_HELP_TParamRecord_Value_Property|Value]] property is ignored.
+
* '''reference''' -- The VistA M Server receives the contents of the corresponding [[RPC_HELP_TParamRecord_Value_Property|Value]] property as a name of a variable defined on the server. Using indirection, the Broker on the server will resolve this parameter before handing it off to the application.
** undefined -- The Broker uses this value internally. It should not be ''used'' by an application.
+
* '''list''' -- This value is used whenever an application wants to send a list of values to the VistA M Server. In this case, the contents of the corresponding [[RPC_HELP_TParamRecord_Mult_Property|Mult]] property is sent, while the [[RPC_HELP_TParamRecord_Value_Property|Value]] property is ignored.
 +
* '''undefined''' -- The Broker uses this value internally. It should ''not'' be used by an application.
 
 
 
 
For instance, if you need to pass an empty string to the remote procedure call ([[RPC_HELP_RPCs|RPC]]), the [[RPC_HELP_TParamRecord_Value_Property|Value]] property should be set to " (i.e., null) and the PType to literal. Using reference, a programmer can pass an M variable (e.g., DUZ) without even knowing its value. However, If the M variable being referenced is not defined on the VistA M Server, a run-time error will occur. When passing a list to an RPC: set the PType to list, populate the [[RPC_HELP_TParamRecord_Mult_Property|Mult]] property, and don't put anything into the Value property (in this case, Value is ignored).
 
For instance, if you need to pass an empty string to the remote procedure call ([[RPC_HELP_RPCs|RPC]]), the [[RPC_HELP_TParamRecord_Value_Property|Value]] property should be set to " (i.e., null) and the PType to literal. Using reference, a programmer can pass an M variable (e.g., DUZ) without even knowing its value. However, If the M variable being referenced is not defined on the VistA M Server, a run-time error will occur. When passing a list to an RPC: set the PType to list, populate the [[RPC_HELP_TParamRecord_Mult_Property|Mult]] property, and don't put anything into the Value property (in this case, Value is ignored).
 
 
For a demonstration using PType, please run the BrokerExample.EXE located in the ..\BDK32\Samples\BrokerEx directory.
+
NOTE: For a demonstration using PType, please run the [[RPC_HELP_BrokerExampleEXE|BrokerExample.EXE]] located in the ..\BDK32\Samples\BrokerEx directory.

Latest revision as of 18:26, 8 July 2015

PType Property

Example

Applies to

   TParamRecord class

Declaration

   property PType: TParamType;
   (PType is a property of the TParamRecord used in the Param property.)

Description

The PType design-time property determines how the parameter will be interpreted and handled by the Broker.

Value -- Definition

  • literal -- The VistA M Server receives the contents of the corresponding Value property as one string or one number.
  • reference -- The VistA M Server receives the contents of the corresponding Value property as a name of a variable defined on the server. Using indirection, the Broker on the server will resolve this parameter before handing it off to the application.
  • list -- This value is used whenever an application wants to send a list of values to the VistA M Server. In this case, the contents of the corresponding Mult property is sent, while the Value property is ignored.
  • undefined -- The Broker uses this value internally. It should not be used by an application.

For instance, if you need to pass an empty string to the remote procedure call (RPC), the Value property should be set to " (i.e., null) and the PType to literal. Using reference, a programmer can pass an M variable (e.g., DUZ) without even knowing its value. However, If the M variable being referenced is not defined on the VistA M Server, a run-time error will occur. When passing a list to an RPC: set the PType to list, populate the Mult property, and don't put anything into the Value property (in this case, Value is ignored).

NOTE: For a demonstration using PType, please run the BrokerExample.EXE located in the ..\BDK32\Samples\BrokerEx directory.