O$5 - $loadcols - loading list values without 'Set Current List'

Mischa mischa at omnislab.com
Thu Mar 12 10:50:03 EDT 2015

Hi Bruno,

welcome to the boat ;)
like you, I also had difficulties from switching from O7 to O$ list
paradigm. the other nice thing with lists, that is not very well explained
in the manuals, is $assignrow()
You can load a complete row from the list with

Do MyRow.$assignrow(MyList)

 where MyRow and MyList have the same definition. Studio again takes the
current line of the list. The command also works the other way round:

Do MyList.$assignrow(MyRow) overwrites the current line of MyList with the
contents of MyRow. So this is a full replacement for Load from list and
Replace line in list, in case you do not want to manipulate list values
directly or need the row elsewhere in your application.

Best greetings

  T H E   O M N I S   L /\ B     www.omnislab.com

-----Ursprüngliche Nachricht-----
Von: omnisdev-en-bounces at lists.omnis-dev.com
[mailto:omnisdev-en-bounces at lists.omnis-dev.com] Im Auftrag von bub
Gesendet: Donnerstag, 12. März 2015 09:14
An: omnisdev-en at lists.omnis-dev.com
Betreff: Re: O$5 - $loadcols - loading list values without 'Set Current

Great solutions, thanks Reg, thanks Kelly!!!


On 12/03/2015 13:26, Kelly Burgess wrote:
> Hi Bruno,
> Like Reg says, you can just "refer to them in place with iList.MyColName."
> But if you want to, the pull/push concept is
>     For iList.$line from 1 to iList.$linecount step 1
>       Do iList.$loadcols()  ;;  load 'crb' with list columns (requires
column vars are in sync and in scope)
>       Calculate someColField as 'new value'
>       < etc >
>       Do iList.$assigncols()  ;;  copy 'crb' fields back to list columns
>     End for
> That's why you sometimes just refer to them in place.  Calculate
iList.someColField as 'new value'  doesn't require that the list be
(re)defined for variables that are in scope for your calculation.
> Kelly
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com

Manage your list subscriptions at http://lists.omnis-dev.com

More information about the omnisdev-en mailing list