F10 vs @LEVEL & @RECUR programming technique (AREV Specific)
At 20 DEC 2001 03:24:12PM Martin Bell wrote:
It seems I'm missing a fundamental concept:
If @LEVEL shows the current recursion level, and @RECUR vars are unique to each level, what does an F10 (start new occurrence of main menu(?)) do to @RECUR vars / @LEVEL?
Background: the AREV 3.12 application in question allows a user to be in a typical window with a record open. Now let's say the user gets an incoming call and needs to jump to another record without getting out of the current record. The user will F10 to open another occurrence of the window, edit the record (for the phone call), update, and escape back to the previous occurrence. Fine. Now consider that the application uses some collector windows off the main window and (perhaps incorrectly) attempts to use @RECUR vars to pass and save information to/from the collector window. (Note that the collector window information is supposed to be a slave record and from a different table to the main window's record – that is, if the main window information is not saved, the collector window information should also be ignored.) But as you may already know, an F10 in this situation doesn't seem to change the recursion level, and thus, the @RECUR vars contain undesired "holdover" information from the previous w
indow occurrence.
How should this be overcome? Is there a better programming technique to deal with the subservient collector windows? Please advise.
Thank you.
At 20 DEC 2001 05:11PM Matt Sorrell wrote:
Martin,
I'm assuming you have a subroutine that wraps your collector window? If so, change the sub to save off the values of @RECUR before doing anything, and then restoring them afterwards.
HoldRecur1=@RECUR1
HoldRecur2=@RECUR2
*call window
*do other stuff
@RECUR2=HoldRecur2
@RECUR1=HoldRecur1
That's one thought. Another is to ditch recurs altogether, using @ID, @RECORD, etc. Or, you could use window registers. The system should keep those separate per instance of the window.
msorrel@greyhound.com
At 20 DEC 2001 06:23PM David Kafka wrote:
Are you calling the window off the menu with a "W" code?
If so, instead of "W" "windowname" do "E" "WINDOW" windowname.
That will guarantee each instance of the window is at a different recursion level.
David