Statements declaration
SYNTAX:
statements_decl = STATEMENTS [ statements_id ] '; ' [ algorithm_head ] stmt { stmt } END_STATEMENTS ';' .
statements_id = simple_id .
algorithm_head = { declaration } [ local_decl ] .
declaraton = constant_decl | function_decl | procedure_decl
The Statements Declarations defines a sequence of statements that is executed independently of any MAP or COMPOSE declarations. The statements declaration begins with the keyword STATEMENTS optionally followed by a name of the statements declaration, followed by the character semicolon, optionally followed by an algorithm head defining local variables. All EDMexpressX statements can be applied within a statements declaration. The keyword END_STATEMENTS terminates a STATEMENTS declaration.
The scope of a statements name is the EDMexpressX mapping schema in which the statements declaration occurs, i.e. the global scope of an EDMexpressX mapping schema.
Example:
STATEMENTS;
LOCAL
fileId : GENERIC;
errorCode : INTEGER;
errText : STRING;
END_LOCAL;
errCode := xpxOpenFile(?/usr/data/result.txt?,?w?,fileId);
IF (errCode = 0) THEN
xpxGetErrorText(errCode,errText);
xpxPrintf(?\nError "%s" in OpenFile?,errText);
.....
END_IF;
.......
END_STATEMENTS;