why not call a function that refers to the list instead of passing a list to a row. It makes it far easier to process multiple items within the method being called and means you don’t have to move data arond
eg .. suppose list has 18 rows, 4 selected.
then you can do
do list.$doMyMethod
and then in $doMyMethod, you can
if $cinst.$totc(#lsel)=0
calculate pErrorMessage as ‘Select whatever rows you want to work on’
quit method kfalse
end if
do $cinst.$first(ktrue) returns #F
while flag true
# do some things to the line in the list
do $cinst.$next(0,ktrue) returns $F
end while
# we processed all selected lines in the list
reasons:
1) in the long run, far easier to simply act on one, or the selected set (or all, if you want) lines in the list.
2) there isn’t any passing of list to row
3) its far easier to keep the method within the table class so that other methods can use it. that way it can be used in many places
4) it improves the opportunity to use inheritance
5) the any updated values in the list ara available to the calling method so you can redraw the list on the window
6) it gets rid of the need to define the row
7) makes code cleaner and kind of forces you to put it in the right place
8) lets you gang up multiple calls to process the list. eg
do list.$editListContents (pErrorMessage) returns $F
if flag false
# oh boy, we had some errors, better display them
quit method #F
end if
do list.$increaseSalary(10%)
do list.$saveList
hopefully that gives a germ on the idea.