Get the layout of a variable
Get the layout of a variable by using the GetLayout method.
Example
The first step, in this example, is to create a variable.
1. Create the variable Variable01. The identifier of the variable is VB01. A comment (in qComment) and a definition (in qDefinition) are set.
The client sends:
{
"jsonrpc": "2.0",
"id": 2,
"method": "CreateVariableEx",
"handle": 1,
"params": [
{
"qInfo": {
"qId": "VB01",
"qType": "Variable"
},
"qName": "Variable01",
"qComment": "My first variable",
"qDefinition": "=Count(Holes)"
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"qReturn": {
"qType": "GenericVariable",
"qHandle": 2
},
"qInfo": {
"qId": "VB01",
"qType": "Variable"
}
},
"change": [
1,
2
]
}
The variable is created and has 2 as a handle.
2. Get the layout of the variable.
The client sends:
{
"jsonrpc": "2.0",
"id": 4,
"method": "GetLayout",
"handle": 2,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 4,
"result": {
"qLayout": {
"qInfo": {
"qId": "VB01",
"qType": "Variable"
},
"qText": "17891",
"qNum": 17891
}
}
}
The identifier (qId) and the type (qType) of the variable are returned. The string (qText) and numeric (qNum) representations of the variable are also returned.