Check the syntax of a script
Check the syntax of a script by using the CheckScriptSyntax Method.
Example
1. Set some values in the script.
The client sends:
{
"jsonrpc": "2.0",
"id": 1,
"method": "SetScript",
"handle": 1,
"params": [
"oad RecNo() as NewNumbers AutoGenerate 10;"
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 1,
"result": {}
}
The script has been updated with the new values. The script creates a table with one column and ten rows.
2. Check the script syntax.
The client sends:
{
"jsonrpc": "2.0",
"id": 4,
"method": "CheckScriptSyntax",
"handle": 1,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 4,
"result": {
"qErrors": [
{
"qErrLen": 3,
"qTabIx": 0,
"qLineInTab": 0,
"qColInLine": 0,
"qTextPos": 0
},
{
"qErrLen": 5,
"qTabIx": 0,
"qLineInTab": 0,
"qColInLine": 1,
"qTextPos": 4,
"qSecondaryFailure": true
}
]
}
}
The list of errors is displayed. The first error area is "oad". The second error area starts at "RecNo" and ends with the next statement.