CoolGen - Syntax
CoolGen - Syntax
• Sequential Actions
• Conditional Actions
• Repeated Actions
• Control Actions
• Entity Occurrence Actions
• Pairing Actions
SET Statement
MOVE Statement
NOTE Statement
IF/ELSEIF/ELSE Statement
+->CASE OF expression-1
+->CASE constant-1
| process statements....
+->CASE constant-1
| process statements....
+->OTHERWISE
| process statements....
+--
FOR Statement
Format 1
+->FOR local-view-1 FROM num-1 TO num-2 BY num-3
| process statements....
+--
Format 2
+->FOR SUBSCRIPT OF group-view-1 FROM num-1 TO
| LAST OF group-view-1
| process statements....
+--
atyam Computer Services Limited 7
Repeated Actions
The FOR EACH repeating action repeats the action group for each
occurrence of an implicitly indexed repeating group view
WHILE Statement
+->WHILE condition-1
| TARGETING group-view-2 FROM THE BEGINNING
| UNTIL FULL
| process statements....
+--
The test for the condition takes place first. If the condition is not met then
there are no iterations.
atyam Computer Services Limited 9
Control Actions
ESCAPE Statement
+-> IF condition-1
| +-> IF condition-2
| | +-> IF condition-3
| | | +-> IF condition-4
| <--------- ESCAPE
| | | +--
| | +--
| +--
| process statements......
+--
atyam Computer Services Limited 10
Control Actions
EXIT STATE IS sets the value of the special attribute, exit state.
USE Statement
Format
process statements....
USE action-block-1
WHICH IMPORTS:import-1,import-2...
WHICH EXPORTS:export-1,export-2...
process statements....
USE Statement
• After execution, the control returns to the statement after the USE
statement.
CREATE Statement
• Entity should be defined in the entity action view of the action diagram.
• If any attribute is not assigned value using SET statement then the
attribute takes the default value defined.
CREATE Statement
Format
READ Statement
• Format
READ Statement
• Example - 1
• Example - 2
READ Statement
• Example - 3
• Format
• Example
• For each iteration, the subscript of the group view will be incremented
by 1.
• Distinct
• Always generate cursor with Distinct.
• Never generate cursor with Distinct.
• Use default.
UPDATE Statement
UPDATE Statement
Example
DELETE Statement
Format
+-> READ entity-view-1
| WHERE [condition-1]
+-> WHEN successful
| DELETE entity-view-1
+-> WHEN not found
| processing statements...
+--
DELETE Statement
• Example
ASSOCIATE Statement
ASSOCIATE entity-view-1
WITH entity-view-2 WHICH relation-1 IT
ASSOCIATE Statement
• Example 1
+->ASSOCIATE loan_transaction
| WITH loan WHICH identifies IT
+--
DISASSOCIATE Statement
DISASSOCIATE entity-view-1
FROM entity-view-2 WHICH relation-1 IT
DISASSOCIATE Statement
• Example 1
+->DISASSOCIATE loan_transaction
| FROM loan WHICH identifies IT
+--
TRANSFER Statement
SUMMARIZE Statement
SUMMARIZE Statement
• Format
• Example
• Format
• Example
MAKE Statement
• Example
COMMAND IS Statement
• Format
COMMAND IS command_value
• Example
COMMAND IS ADD
Screen Design
• Fields.
• Literals.
• Prompts.
• Special Fields