[EVALUATE] (re-evaluate)
[EVALUATE] defines a process block. This process block analyzes the syntax of code during execution. By enclosing a variable in percent signs (%), you can resolve the value held by the variable during execution. This tag is used when you are dynamically generating search conditions.
Syntax
[EVALUATE] process-block [EVALUATE_END]
Values
-
process-block
Codes the process block by which data is to be processed. The syntax of the tags in the process block must be complete. You can also specify a syntax that includes tags within variables enclosed by percent signs (%).
Examples
- Example 1
-
This example determines the search conditions during execution by changing the search condition section to variables. This example indicates an asset number R11111 and an asset ID with an asset status of 002:
[SET_VALUE] STATEMENT = '(AssetInfo.AssetNo = ''R11111'') and' + CRLF STATEMENT = STATEMENT + '(AssetInfo.AssetStatus = ''002'')' [EVALUATE] [CLASS_FIND] AssetInfo [FIND_DATA] %STATEMENT% [GET_VALUE] ASSETID = AssetInfo.AssetID [SET_VALUE] STATUS = $GETSTATUS() [EVALUATE_END] [IF] (STATUS = NORMAL) [THEN] [SET_VALUE] MSG = ' ASSETID = ' + ASSETID $ECHO(MSG) [ELSE] [SET_VALUE] MSG = 'CLASS_FIND (' + STATUS + ')' $ECHO(MSG) [IF_END]
- Execution result:
-
ASSETID = 10000
- Example 2
-
This example stores the processing used to acquire a user name from a user ID into variables and searches the results:
[SET_VALUE] STATEMENT = '[CLASS_FIND]' + CRLF STATEMENT = STATEMENT + 'UserEntry' + CRLF STATEMENT = STATEMENT + '[FIND_DATA]' + CRLF STATEMENT = STATEMENT + 'UserID = ' + USERID + CRLF STATEMENT = STATEMENT + '[GET_VALUE]' + CRLF STATEMENT = STATEMENT + 'USERNAME = UserEntry.UserName' + CRLF [EVALUATE] %STATEMENT% [EVALUATE_END]