Opps, sorry, thinking about the (0) or (1) in the function rather than the result!
Obviously - with my brain in gear - a key must be text, as Brad has discovered following your correction. Ahh, just read Brad's second reply and Javier's response. That made me re-look at the original question: Brad, are you trying to use [Esc]-aping from PrnSetUp as a way of abandoning the print rather than abandoning PrnSetUp? If so, I suggest you simply put a Yes/No dialog box in your code to confirm or quit the printing after the PrnSetUp dialog box. I think, if I remember correctly, there's been some discussion of the results from OS boxes before on this list. Javier seems to have re-discovered this with his test - remember that this is not the same as a key returned from WITHIN R:Base. Whether it ought to be is another question... Thanks & regards, Alastair. ----- Original Message ----- From: "William Cook" <[EMAIL PROTECTED]> To: "RBASE-L Mailing List" <[EMAIL PROTECTED]> Sent: Wednesday, March 26, 2003 10:47 PM Subject: [RBASE-L] - Re: Bail-Out After Prnsetup Invoked, LASTKEY Usage > It should be TEXT not INTEGER > > ----- Original Message ----- > From: "Brad Davidson" <[EMAIL PROTECTED]> > To: "RBASE-L Mailing List" <[EMAIL PROTECTED]> > Sent: Wednesday, March 26, 2003 2:42 PM > Subject: [RBASE-L] - Re: Bail-Out After Prnsetup Invoked, LASTKEY > Usage > > > > Alastair, > > > > An attempt in declaring variable vlast as data type integer returned > > following errors: (2178) value does not have same type/scale as > variable > > vlast, and, (2418) Invalid Integer value , so now program bails in > all > > cases. Know there's a big 'duh' in here, but appreciate someone > pointing > > this out to me. Any other ideas - can you duplicate? > > > > > > Thanks! > > -Brad Davidson > > > > > > Alastair Burr wrote: > > > > > > Brad, It _looks_ to me as if the version you have currently should > work > > BUT do you have the variable vLast declared beforehand? If not, try > > adding: SET VAR vLast INTEGER = NULL after your line: -- Per RSyntax > > Version Regards,Alastair. > > > > ----- Original Message ----- > > From: Brad <mailto:[EMAIL PROTECTED]> Davidson > > To: RBASE-L <mailto:[EMAIL PROTECTED]> Mailing List > > Sent: Wednesday, March 26, 2003 4:41 PM > > Subject: [RBASE-L] - Bail-Out After Prnsetup Invoked, LASTKEY Usage > > R:Base Windows 6.5++ Bld 1.864 > > > > Appreciate some advice on this. How does one "bail-out" after > prnsetup > > invoked? See LASTKEY usage after prnsetup below. Have attempted 2 > > scripting methods, both fail when running at the r:\ prompt - that > is, > > the file is printed anyway, though ESC key pressed. Inconsistent > > behaviour while tracing: sometimes prints, sometimes doesn't, and > when > > it doesn't, flashes back to r:\ with no error message and > disappearing > > cursor (assuming some error occurs but can't trap it). TIA! > > > > > > Brad Davidson > > > > > > ******************************** > > -- LISTABLE.RMD > > > > > > CLS > > CLEAR VAR vtab > > CLEAR VAR vlast > > 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 > > > > > > > > >

