Focal Point
[CLOSED] Looping Through a Maintain Stack?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7067094516

January 16, 2012, 01:27 PM
Clay Williams
[CLOSED] Looping Through a Maintain Stack?
I am trying to LOOP through a stack and display the values from a column for each row where the condition is true = Security_Type EQ 3. Then plug each different value into separate varibles (office 1, office 2 - 8) so I can have them display in a Edit Box. Any ideas? Lost!

Security_Type Value_String All_Flag
1 TEK 0
2 TEKNE 0
3 00001 0
3 00006 0

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.701
HTML, PDF, EXCEL
January 16, 2012, 03:30 PM
Maintain Wizard
Hi Clay -
The issue here is, is the answer set finite or infinite? If it is finite I would do something like this:

Assume STK1 contains all of your data. INFER the same fields into STK2 to create but not load it.

STACK COPY FROM STK1 INTO STK2
WHERE SECURITY_TYPE = 3;
-* This loads all the matching values into a new stack. Then
Compute office1 = stk2(1).value_string;
Compute office2 = stk2(2).value_string;
Compute office3 = stk2(3).value_string;
...
Compute office8 = stk2(8).value_string;

If the values are not finite you could display the column of STK2 in a grid and allow the users to edit the data that way.

Mark
January 16, 2012, 03:50 PM
Waz
There is always the backup plan of calling FOCUS to return a record set back to Maintain.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

January 16, 2012, 03:55 PM
Clay Williams
how is that done?


WebFOCUS 7.701
HTML, PDF, EXCEL
January 16, 2012, 04:09 PM
Waz
Look up EXEC in the documentation, it calls a WebFOCUS proc.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!