References while sorting lists

Michael Monschau michael at
Wed Mar 13 14:18:41 EDT 2013

Hi Will,

I am not sure I understand your question but I have a go

When you do

Set reference ref to [$cfield.$dataname]

Omnis expects the contents of the square brackets to contain a notation string it can create a reference from. However $cfield.$dataname will just return a variable name which is in it self is not valid notation. However when you do

Set reference ref to [$cfield.$dataname].$ref

what Omnis receives is something like ivMyVar.$ref which is a valid notation string and Omnis knows what to do with it.

When you have to pass an item reference as a parameter to a notation function, the same rules apply as they do for the Set reference command.


Michael Monschau (Director)
Brainy Data Limited

Reply To: michael at
Phone: +44 (0)870 474 0708
Web: the home of Omnis Components and Developer Services

On 13 Mar 2013, at 12:46, Will Adkin wrote:

> Hi List,
> Trying to get my head around this omnis behaviour
> I have the following generic line of code that will sort a headed list on evHeaderClick
> Do $ctask.oPrefs.$sortHeadedList($cfield,[$cfield.$dataname].$ref,pColumnNumber,iSortAscending)
> I receive the second parameter as a field ref and all works OK, but if i change the second param to [$cfield.$dataname] and receive it as a field ref it no longer works, why is this? the square brackets do not appear to have been evaluated and rather than referencing the list it seems to be referencing the string: "[$cfield.$dataname]"
> Also, i have been trying to do the same thing without needing to send in a reference to the list variable - using only a reference to the headed list field I thought I should have been able to get a reference to the list data it was using, I tried to set a reference to the $contents of the field so i could sort that directly, but while I can calculate $contents into a different list i don't appear to be able to set a reference to it... 
> Maybe I am going about this the wrong way? 
> Will
> Will Adkin, Software Development Manager, Lineal Software Solutions Ltd
> Apple Reseller, Microsoft Partner, SQLWorks Business Partner
> office phone: 01271 850550 | web: | email: will at
> _____________________________________________________________
> Manage your list subscriptions at

More information about the omnisdev-en mailing list