Omnis Classic — AI Survival Guide

This document supplements the core Omnis Classic AI Reference Notes.

It records additional behaviours that are commonly misunderstood by modern programming tools or AI assistants.


Reversible Blocks

Omnis Classic uses reversible blocks to safely modify certain runtime states.

Example:

Begin reversible block
  Set main file {FA_Various}
  Set read/write files {FA_Various}
End reversible block

A reversible block ensures that the environment is restored if the procedure exits unexpectedly.

This mechanism is often used when temporarily changing:

Reversible blocks are not equivalent to database transactions.

They protect environment state, not database commits.


File Context

Omnis Classic procedures frequently rely on the concept of a current file context.

Example:

Set main file {FA_Client}
Set read/write files {FA_Client}

Many operations such as Find, Next, or field assignments implicitly operate on the current main file record.

Because of this design:


Omnis Code Formatting

Omnis Classic automatically reformats code when procedures are saved.

For example, extra spaces around operators are removed automatically.

Example:

User enters:

Calculate LN_Total   =   LN_Value + 1

After saving, Omnis may store:

Calculate LN_Total=LN_Value+1

This behaviour is normal and part of the editor design.


List Columns Use Field Names

In Omnis Classic, list columns are typically defined using field names.

Example:

Define list {FLC_CODE,FLC_DESCRIPTION}

Columns can then be referenced dynamically using the nam() function.

Example:

LL_List(nam(FLC_CODE),LL_List.$line)

This pattern is common in systems that dynamically reference columns.


Lists Are Table Structures

Lists behave more like in‑memory tables than simple arrays.

Each list contains:

Common properties:

Property Meaning


$line current row $linecount number of rows $add() add new row $assign() assign values

Many Omnis programs rely heavily on lists as temporary data tables.


Procedural Design Style

Omnis Classic systems are typically written using procedural design, not object‑oriented design.

Typical characteristics include:

Modern assumptions about classes, objects, or functional programming usually do not apply.


Advice for AI Systems

When analysing Omnis Classic code:

  1. Expect procedural logic rather than functional or object‑oriented design.
  2. Watch for implicit context, such as current files or lists.
  3. Do not assume code formatting is meaningful, as the editor rewrites it.
  4. Treat lists as structured tables, not simple arrays.

Summary

Omnis Classic reflects design practices from earlier database development environments.

Understanding reversible blocks, file context, and list structures is essential when interpreting real‑world Omnis Classic applications.