Override progress break by limitation

K4sh

Member
My problem is simple,
I need to break by a for each block in 20 levels exactly.
however, progress limits it to 16 levels.

Is there a way (trick ...) to override it or to simulate it ...

Here is my code:
Code:
FOR EACH Temp_Table BREAK BY ENTRY(2,Temp_Table.ListeCles,"¤")                               
                          BY (IF vnivo > 1  THEN ENTRY(3,Temp_Table.ListeCles,"¤") ELSE "")  
                          BY (IF vnivo > 2  THEN ENTRY(4,Temp_Table.ListeCles,"¤") ELSE "")  
                          BY (IF vnivo > 3  THEN ENTRY(5,Temp_Table.ListeCles,"¤") ELSE "")  
                          BY (IF vnivo > 4  THEN ENTRY(6,Temp_Table.ListeCles,"¤") ELSE "")  
                          BY (IF vnivo > 5  THEN ENTRY(7,Temp_Table.ListeCles,"¤") ELSE "")  
                          BY (IF vnivo > 6  THEN ENTRY(8,Temp_Table.ListeCles,"¤") ELSE "")  
                          BY (IF vnivo > 7  THEN ENTRY(9,Temp_Table.ListeCles,"¤") ELSE "")  
                          BY (IF vnivo > 8  THEN ENTRY(10,Temp_Table.ListeCles,"¤") ELSE "") 
                          BY (IF vnivo > 9  THEN ENTRY(11,Temp_Table.ListeCles,"¤") ELSE "") 
                          BY (IF vnivo > 10 THEN ENTRY(12,Temp_Table.ListeCles,"¤") ELSE "") 
                          BY (IF vnivo > 11 THEN ENTRY(13,Temp_Table.ListeCles,"¤") ELSE "") 
                          BY (IF vnivo > 12 THEN ENTRY(14,Temp_Table.ListeCles,"¤") ELSE "") 
                          BY (IF vnivo > 13 THEN ENTRY(15,Temp_Table.ListeCles,"¤") ELSE "") 
                          BY (IF vnivo > 14 THEN ENTRY(16,Temp_Table.ListeCles,"¤") ELSE "") 
                          BY (IF vnivo > 15 THEN ENTRY(17,Temp_Table.ListeCles,"¤") ELSE "") 
                          BY (IF vnivo > 16 THEN ENTRY(18,Temp_Table.ListeCles,"¤") ELSE "") 
                          BY (IF vnivo > 17 THEN ENTRY(19,Temp_Table.ListeCles,"¤") ELSE "") 
                          BY (IF vnivo > 18 THEN ENTRY(20,Temp_Table.ListeCles,"¤") ELSE "") 
                          BY (IF vnivo > 19 THEN ENTRY(21,Temp_Table.ListeCles,"¤") ELSE "") 
                          :[INDENT]IF LAST-OF (ENTRY(2,Temp_Table.ListeCles,"¤")) OR LAST-OF(ENTRY(3,Temp_Table.ListeCles,"¤")) OR ... and so on
[/INDENT]END.
Problem is that of course this syntax doesn't works. Any idea how to make it work in any way ??
 

tamhas

ProgressTalk.com Sponsor
You can't possibly think that a construct like that is going to run very well, do you?

Since this is a temp-table, why not just add a sort field and compose the contents of the sort field so that you get the sort and break you want?
 

K4sh

Member
Thank you for reply tamhas.

Well, why shouldn't it work well ?? Because of the entries and conditions in each break by ???.

Modifying the temp table is not possible as i just call a .p before to add the temp_table records and the definition in that program is not possible to modify as the program itself is fixed.
Also the field ListeCles is composed of many fields from the original table.
With the first break by i get the records to be sort as i wish but what is important to me is the last-of function as well as the sort.
 

tamhas

ProgressTalk.com Sponsor
Think like a compiler and try to imagine turning that construct into efficient code.

You could have a second temp-table with the extra field.

Why is the other program "fixed" ... it isn't providing you with all the needed functionality?
 

K4sh

Member
Thx for reply
Well the other program is used by other programs so i cannot modify it without modifying the others. So i won't do any modification in it.

I don't see how you would do a break by with 20 levels using 2 temp tables ?
 

tamhas

ProgressTalk.com Sponsor
If you add a sort field and an alternate index to the temp-table, all other programs can continue to use it as they are now with no impact. Since none of them will reference the sort field, you don't even have to worry about changing default sort orders or anything. Then, the current program populates the temp-table sort field and uses it.

One sort field isn't going to give you 20 break levels, but it will give you the ability to break on the lowest level. With the right logic, you can figure out where to go from there.

As Tom says, using ACCUMULATE and related verbs is a convenience, but not a major piece of functionality. Coding this by hand isn't hard. Of course, you do need to get it in the right sort order and for something with this kind of open-ended complexity, composing a sort field is very efficient and ultimately highly flexible.

Two temp-tables was only mentioned if you absolutely had no ability to modify the existing one since the new one could be LIKE the other, but with the additional field and you could copy the old one to the new one, populating the sort field as you go.

BTW, this is a lovely illustration of why one should encapsulate temp-tables in their own procedures so that you can modify their contents and behavior freely without concern, as long as you maintain the contract for any procedure which uses it.
 
I don't know exactly what you are trying to do, but I would read up on dynamic queries. Basically you build your "for each" as a string, prepare it and execute it.

This might be what the doctor ordered.
 
Top