$loadcols $colcount

Doug Easterbrook doug at artsman.com
Mon Apr 18 14:21:26 UTC 2022

hi Kelly.

there is an interesting subtlety to $addcols when used with schema classes and file variables.

if you have a file class with some variables in it.  like ‘gDate’ or ‘myChar’ or ’theInteger’ and they are defined as date, character and integer respectively.


do list.$defineFromSqlClass(’nameofSqlclass’)
do list.$addcols(‘gDate’)
do list.$addcols(‘myChar’)
do list.$addcols(’theInteger’)

will add columns to the query or schema and define the columns according to the definition in the file class for you without having to specify the other parameters.

we find this subtlety quite handy since we use file classes for sql substitution (neat postgres trick) and other things for reports and calculated columns.

it means if you change the column definition in the file format, it changes in your code.   so if you change from 32 bit integer to 64 bit, — it just happens everywhere.

don’t know how we discovered it..  but we use it a lot

Doug Easterbrook
Arts Management Systems Ltd.
mailto:doug at artsman.com
Phone (403) 650-1978

> On April 18, 2022, at 6:21 AM, Kelly Burgess <kellyb at montana.com> wrote:
> Hi Martin,
>> Difference:$cols.$add versus $addcols
> I wasn't aware of $addcols.  According to the docs it's an extensible version of $cols.$add.
>   https://omnis.net/developers/resources/onlinedocs/Programming/06listprog.html#adding-columns
> "..can be used to add one or more columns to a list or row variable, so the parameter count must always be a multiple of four."
> Kelly
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 

More information about the omnisdev-en mailing list