Omnis Classic — AI Reference Notes

This document records several important behavioural rules of Omnis Classic that are commonly misunderstood by modern programming tools and AI assistants.

Omnis Classic predates many modern programming conventions.
Assumptions based on languages such as Python, JavaScript, Java, or C often lead to incorrect interpretations of Omnis code.

These notes summarise the most important differences.


Boolean Behaviour

Boolean expressions evaluate to numeric values.

Expression Result


False 0 True 1

Example:

Calculate LB_Found as FLC_CODE="ABC"

If the comparison is true, LB_Found becomes 1.
If false, it becomes 0.


The pick() Function

The pick() function selects a result based on a numeric index.

Syntax:

pick(expression, result_if_0, result_if_1, result_if_2, ...)

Meaning:

expression value returned result


0 result_if_0 1 result_if_1 2 result_if_2

Example:

pick(LB_Ok,"Failed","Success")

If LB_Ok is:

LB_Ok Result


0 “Failed” 1 “Success”

Important: pick() is not equivalent to a ternary operator.


Procedure Status via #F

Many Omnis Classic operations return success or failure using the flag field #F.

Typical pattern:

Call procedure $findVar (LC_Code,PC_Which)
If #F
  ;; operation succeeded
Else
  ;; operation failed or cancelled
End If

Procedures often return their status explicitly:

Calculate #F as LB_Ok
Quit procedure

#F value Meaning


0 failed 1 succeeded


Procedures Instead of Functions

Omnis Classic does not support user-defined functions that return values directly.

Modern-style code such as:

result = myFunction(parameter)

does not exist in Omnis Classic.

Instead, procedures are used.

Results are returned through:

  1. Field name parameters
  2. The flag field #F
  3. Shared fields or lists

Example:

Call procedure $getValue (LC_Result)

Inside the procedure:

Parameter PF_Return (Field name)
Calculate PF_Return as LC_Value

The caller receives the value through the parameter.


Field Name Parameters

Parameters declared as:

Parameter PF_Text (Field name)

represent a reference to a field, not a copy of its value.

Assignments modify the caller’s variable.

Example:

Calculate PF_Text as "Updated"

The original field passed into the procedure is updated.


Lists

Lists are a fundamental data structure in Omnis Classic.

Lists behave like tables with named columns, not simple arrays.

Typical usage:

Define list {FLC_CODE,FLC_COMMENT}
Merge list LL_Source_List
Set current list LL_Work_List

Common functions:

Function Purpose


totc() iterate through a list pos() substring search max() maximum value nam() dynamic column reference


Important Notes for AI Tools

When analysing Omnis Classic code:

  1. Treat Boolean values as numeric (0 / 1).
  2. Interpret pick() as index selection, not conditional logic.
  3. Check the value of #F after procedures.
  4. Remember that Field name parameters modify the original variable.
  5. Do not assume the language supports user-defined functions.

Summary

Omnis Classic is a consistent procedural language but differs significantly from modern programming environments.

Understanding these behaviours is essential when reading or modifying Omnis Classic systems.