Yo PEGmeisters,
Is there a way to dynamically change sort sequence in a for each stmt?
Such as:
<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
case caps(input frame f-in t-sort-seq):
when "D" then T_BY_PHRASE = "by vendor.pay-lst-yr descending".
when "B" then T_BY_PHRASE = "by vendor.vend-num".
otherwise T_BY_PHRASE = "by vendaddr.name".
end. /* case */
for each vendor no-lock where
{lib/rangcond.i &file=symix.vendor &field=vend-num &type=ch
&low=""~~001""},
symvend.vendaddr of vendor no-lock
{&T_BY_PHRASE}
on endkey undo, leave:
[/code]
The above code snippet will compile but does not work, it sorts by vend-num
(primary index) no matter what the value of T_BY_PHRASE is.
Can this be done in progress?
cheers
Chas. E. Lehnert
CPFP IS Mgr
616 847 1890 (v)
616 847 3109 (f)
Is there a way to dynamically change sort sequence in a for each stmt?
Such as:
<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
case caps(input frame f-in t-sort-seq):
when "D" then T_BY_PHRASE = "by vendor.pay-lst-yr descending".
when "B" then T_BY_PHRASE = "by vendor.vend-num".
otherwise T_BY_PHRASE = "by vendaddr.name".
end. /* case */
for each vendor no-lock where
{lib/rangcond.i &file=symix.vendor &field=vend-num &type=ch
&low=""~~001""},
symvend.vendaddr of vendor no-lock
{&T_BY_PHRASE}
on endkey undo, leave:
[/code]
The above code snippet will compile but does not work, it sorts by vend-num
(primary index) no matter what the value of T_BY_PHRASE is.
Can this be done in progress?
cheers
Chas. E. Lehnert
CPFP IS Mgr
616 847 1890 (v)
616 847 3109 (f)