Thanks so much Javier & Alastair for your advisal! Yes, erroneously looking for a key return within rbase, rather, a function of prnsetup. This exampled in the invoking of Javier's script suggestion, after pressing ESC key from within setup, vlast variable returns [Enter] with write statement 'Enter Pressed', not [ESC] and accompanying write script. Has anyone else found a work around this prnsetup bail-out?
Regards, Brad Davidson Javier Valencia wrote: > Brad: > I run the following snippet to check what is the value returned by PRNSETUP > =============================== > SET VARIABLE vlast TEXT = NULL > SHOW VAR vlast > PRNSETUP > SET VARIABLE vlast = (LASTKEY(0)) > SHOW VAR vlast > IF vlast = '[Esc]' THEN > WRITE 'ESCAPE PRESSED' > ELSE > WRITE 'ENTER PRESSED' > ENDIF > RETURN > =============================== > Regardless of what option I select form 'OK' 'CANCEL', <ESC> or press the X > on the corner of the window the variable vlast always comes back as [ENTER}; > when I am in the trace mode and press <ESC> it executes the rest of the > commands and exits the command file. I believe that when you press <ESC> the > last key should return [ESC] and not [ENTER]. > I though that maybe the error variable may catch the <ESC> key, so I tried > the following code: > =============================== > > SET ERROR VARIABLE vderr > SET VARIABLE vlast TEXT = NULL > SHOW VAR vderr > SHOW VAR vlast > PRNSETUP > SET VARIABLE vlast = (LASTKEY(0)) > SHOW VAR vlast > SHOW VAR vderr > IF vlast = '[Esc]' THEN > WRITE 'ESCAPE PRESSED' > ELSE > WRITE 'ENTER PRESSED' > ENDIF > RETURN > =============================== > The result was the same as the error variable did not change. There may be a > reason for this condition, but to me, it sure looks like a bug,,, > I am running WIN98 SE, 6.5++, build 1.864xRT03, and I was able to duplicate > the condition on my laptop running XP HOME. > Javier, > > Javier Valencia, PE > President > Valencia Technology Group, L.L.C. > 14315 S. Twilight Ln., Suite #14 > Olathe, KS 66062-4571 > (913)829-0888 > (913)649-2904 FAX > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Brad Davidson > Sent: Wednesday, March 26, 2003 5:03 PM > To: RBASE-L Mailing List > Subject: [RBASE-L] - Re: Bail-Out After Prnsetup Invoked, LASTKEY Usage > > > Yes, that did it! First declare variable with CORRECT datatype - oh well, > > back to basics, eh? Thank you. > > > > Oops, spoke too soon - original problem recurs. Beginning to think this an > OS > issue ? Using Windows 2000. Again, ESC key after prnsetup still prints hard > copy. Yet, when tracing, properly returns via label Finish. Can anyone > duplicate this? > > > > > R:Base Windows 6.5++ Bld 1.864 > > > > ******************************** > > > > -- LISTABLE.RMD > > > > > > > > > > > > CLS > > > > CLEAR VAR vtab > > > > CLEAR VAR vlast > > SET VAR VLAST TEXT = NULL > > > > > SET VAR vtab TEXT = NULL > > > > > > > > > > > > > CHOOSE vtab FROM #TABLES AT 5 10 TITLE 'TABLE INFO' + > > > > CAPTION 'Print Table Specs For ONE Table, As Selected' + > > > > LINES 20 FORMATTED > > > > > > > > > > > > IF vtab IS NULL OR vtab = '[Esc]' THEN > > > > GOTO finish > > > > ENDIF > > > > > > > > > > > > DELETE tempfile.txt > > > > OUTPUT tempfile.txt > > > > SET LINES 0 > > > > LIST .vtab > > > > SET LINES 20 > > > > OUTPUT SCREEN > > > > PRNSETUP > > > > > > > > > > > > -- IF (LASTKEY(0)='[esc]') THEN > > > > -- GOTO finish > > > > -- ENDIF > > > > > > > > > > > > -- Per RSyntax Version > > > > > > > > > > > > SET VARIABLE vlast = (LASTKEY(0)) > > > > IF vlast = '[Esc]' THEN > > > > GOTO finish > > > > ENDIF > > > > > > > > > > > > OUTPUT PRINTER > > > > TYPE tempfile.txt > > > > OUTPUT SCREEN > > > > > > > > > > > > LABEL finish > > > > CLS > > > > RETURN > > > > > > > > > > > > > > > >

