Simply Higher

An in-depth primer to help you create your first One Level Higher
form, and understand what you are doing!

Lets start with the most simple implementation of the One Level Higher
concept. In it I will cover all the basic things you need to do, to save having
to repeat those details in the later variations. Ill cover the basics in
detail, but you can cut to the chase by looking at the five minute checklist
at the end of this article.

The Top Table

The concept uses a top, parent table, from which other related tables are then
hung. Any table can act as the parent. I use one I call Looper, so named
because when I first started using it, I wanted to loop x number of times
through a for statement in a DQL. Looper is really a set of ordered integers,
or ordinal numbers, stored in a field called LooperNo.

Integral to a flexible implementation of One Level Higher is the use of the
custom functions named get/setglobal. These functions refer to their contents
via a number, so we can match the value in the global with the value of the
Looper record.

Currently, the simplest way to persist a value throughout a DataEase For Windows
application session is using these functions. Were Sapphire to change, say, DQL
global variables so we could refer to them in forms, or were a third-party CDF
writer to build a library that let us refer to an in-memory value by name, then
other options would open up.

To simplify the discussion, I will refer to these as global values. Please dont
confuse them with DQL globals

Looper has a virtual field vMatch that picks up the global value, and is used as
the the match field in relationships to the true table records we want.
vMatch is derived:

If ( LooperNo < = 255 , getglobal ( LooperNo ) , blank )

The get/setglobal library affords us 255 variables, which should be sufficient
for most application sessions. The if statement simply helps avoid the GPF we
will get if we try to access nonexistent values at location 256 and beyond. I
will discuss Looper in depth in a later article.