I am doing a massive Clipper conversion and have converted to dozens of DCBROWSE on arrays. I realize now that to go back and add DCBROWSECOL SORT that I would need to browse a dbf not an array.
Is there a way to use Sort on an array browse? Perhaps use Asort() in the SORT codeblock ?
Can't find an example or any posts on this forum.
Just wondering if it is possible or do I go back in a cave and begin rewriting dozens of Browses.
DCBROWSECOL SORT On an Array
- sdenjupol148
- Posts: 151
- Joined: Thu Jan 28, 2010 10:27 am
- Location: NYC
Re: DCBROWSECOL SORT On an Array
Hey GeneB,
Easy to do.
Just use ASort() within your SORT clause as in:
#DEFINE FIRST_NAME 1
#DEFINE LAST_NAME 2
aNames := { {"Roger", "Donnay"}, {"Gene","B"}, {"Bobby",Drakos"}}
DCBROWSECOL HEADER "Last Name";
ELEMENT LAST_NAME WIDTH 10 ;
TOOLTIP "Person's Last Name" ;
SORT {|| ASort(aNames,,,{|a,b| a[DUE_MEDNUM] < b[DUE_MEDNUM] })}
Bobby
Easy to do.
Just use ASort() within your SORT clause as in:
#DEFINE FIRST_NAME 1
#DEFINE LAST_NAME 2
aNames := { {"Roger", "Donnay"}, {"Gene","B"}, {"Bobby",Drakos"}}
DCBROWSECOL HEADER "Last Name";
ELEMENT LAST_NAME WIDTH 10 ;
TOOLTIP "Person's Last Name" ;
SORT {|| ASort(aNames,,,{|a,b| a[DUE_MEDNUM] < b[DUE_MEDNUM] })}
Bobby
Re: DCBROWSECOL SORT On an Array
Thanks, Bobby, that works perfectly.
As a point of information, when I was first trying to use it I left OrdSetFocus() in the block for the first element as shown because that column would sort as in the example but it didn't seem to let other columns sort.
You have saved me many, many hours.
The more I discover new features in Express the more impressed I am. It is an amazing product, and this forum is priceless.
GeneB
As a point of information, when I was first trying to use it I left OrdSetFocus() in the block for the first element as shown because that column would sort as in the example but it didn't seem to let other columns sort.
You have saved me many, many hours.
The more I discover new features in Express the more impressed I am. It is an amazing product, and this forum is priceless.
GeneB