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
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
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.
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
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.
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.
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
Can you give me an example of how the rbasic code would look?
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