Omnis Classic β JACSoft Patterns
This page documents common patterns used in JACSoft Omnis Classic code.
π§ General Style
- Procedural (not object-oriented)
- Field names used directly
- Variables prefixed (LB_, LC_, LN_, etc.)
- Boolean values are 0 / 1
pick()uses positional logic
πΎ File Update Pattern
Centralised update procedure:
Call procedure MAg_Files/1 {Do update}
Underlying behaviour:
Prepare for update
... changes ...
Update files
Cancel:
Cancel prepare for update
π Primary Key Pattern
Typical pattern for new records:
Repeat
Call procedure $createPrimaryKey
Calculate [PK_Field] as LN_PKey
Test for a unique index value on [PK_Field]
Update files
Until LB_Test
π File Context
- Operations act on the current file
sys(82)used to determine file name- Record buffer is implicit
π Find Pattern
Single record:
Find on FAC_Seq
Used before:
- Prepare for update
- Editing fields
π List Handling
- Lists use field names as columns
- Access via:
<!-- -->
FL_List.FieldName
nam(FieldName)
- Common functions:
totc()maxc()minc()
π pick() Usage
Example:
Calculate PN_Value as pick(LB_Ok,ValueIfFalse,ValueIfTrue)
0β first value\1β second value
π§± Reversible Blocks
Used for controlled updates:
Begin reversible block
...
End reversible block
π§ Final Rule
Follow existing JACSoft code patterns.
Do not modernise, refactor, or βimproveβ syntax unless explicitly required.