Loop Within a Loop (AREV Specific)
At 07 DEC 2004 02:25:41AM Jim Dierking wrote:
I am getting a runtime error when I attempt to run a loop within a loop.
The routine performs a select on file1 then does a primary loop reading each record. The @ID of each select record is then used to select records in file2 and then does a secondarly loop reading each record in file2.
The select statement stays active and when the secondary select is run the runtime error occurs.
Is it possible to run two selects without interaction?
TIA, Jim Dierking
At 07 DEC 2004 03:56AM [email protected] wrote:
What is the error? To run two active selects you must use the extended select using cursor syntax. Normally people just do the first, then use push and pop select to do the second.
The Sprezzatura Group Web Site
World Leaders in all things RevSoft
At 07 DEC 2004 06:43AM Richard Hunt wrote:
I have no problem with running a loop with an active select list within a loop running an active select list. I just use the extended select.
You might have a programming problem. Maybe if you give more detail or even the summarized version of your two loops and selects too.
At 07 DEC 2004 08:29AM The Sprezzatura Group wrote:
You can run two selects concurently only is you use REDUCE/SELECT, which are the BASIC+ constructs RLIST() is written around.
There's an SENL article about how to use Reduce and Select.
The Sprezzatura Group
World Leaders in all things RevSoft
At 07 DEC 2004 09:00AM Steve Smith wrote:
Jim,
Sprezzatura's suggestion - PUSH.SELECT ahead of your inner loop's SELECT and POP.SELECT following it, will achieve your goal.
It may also be possible to use BTREE.EXTRACT in the inner loop instead of a second select statement.
The problem also arises in another context - where a select list is active in an entry window and a symbolic uses a SELECT to aggregate data from multiple records.
At 07 DEC 2004 11:20AM Jim Dierking wrote:
Is PUSH.SELECT a system subroutine. How do you use it in Rbasic.
I tried Perform 'PUSH.SELECT ' , which didn't work.
I tried CALL PUSH.SELECT , which didn't work.
I couldn't find any info in the AREV manuals regarding push.
At 07 DEC 2004 11:42AM [email protected] wrote:
See Revelation System Subroutines and Knowledge Base
Effectively both subroutines take 4 parameters and should be called before (push) and after (pop) the select.
The Sprezzatura Group Web Site
World Leaders in all things RevSoft
At 07 DEC 2004 12:16PM Jim Dierking wrote:
Can you give me an example of how the rbasic code would look?
At 07 DEC 2004 12:43PM [email protected] wrote:
A="
B="
C="
D="
Call Push.Select(A, B, C, D)
* Do other select stuff
Call Pop.Select(A, B, C, D)
The Sprezzatura Group Web Site
World Leaders in all things RevSoft