had an Idea about my post in August 2010 about EXCP=2 on first read


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]

Posted by Bob A on August 09, 2012 at 09:00:23:

The expected SET statement:
SET excp02BeginningOfFile = 02
The Exception Handler for KEY
!===========
EXCPSUB.KEY:
!===========
! RTN$="EXCPSUB.KEY"
RC.GOOD.KEY$ = N.ANS$ ! (Y/N)
SELECT CASE EXCP
CASE excp02EndOfFile
RETURN
CASE ELSE
ERROR
ENDSELECT
RETURN

The code:

POSITION(SO1) KEY = ORNBR$
DO
RC.GOOD.KEY$ = Y.ANS$
KEY.SO1$ = KEY(SO1,EXCPSUB=EXCPSUB.KEY)
IF RC.GOOD.KEY$ EQ N.ANS$ THEN BREAK
IF SUB(KEY.SO1$,1,9) NE ORNBR$ THEN BREAK

This code will work, since I'm testing RC.GOOD.KEY$ to BREAK
when I tested
IF EXCP EQ excp02BeginningOfFile THEN BREAK
it failed on first loop

when I dump both RC.GOOD.KEY$ and EXCP right after the KEY statement, I noticed that:

RC.GOOD.KEY$ stays equal to Y.ANS$ on every "good" KEY (i.e. there really is a record there) even though EXCP = 2
on the last KEY, when I've exhausted the data, EXCP EQ 2 and RC.GOOD.KEY$ EQ N.ANS$ because it raised the Exception (EXCP now really was 2) and entered EXCPSUB.KEY where RC.GOOD.KEY$ was set to N.ANS$ ("N")

So, by testing the RC set in the EXCPSUB, I can be sure that an exception really was raised, the EXCPSUB really was entered, and the EXCP truely is 2

Just took me a long time to re-generate the problem, although I'm not ruling out the possibility that I've got some hidden problem elsewhere that causes this unusual situation of EXCP = 2, after a KEY statement, until it really is 2.

Most of this is probably moot, since the code I've seen is almost universally of the "EXCP = 1234" style.

maybe my contrarian ways (i.e. EXCPSUB=) are causing my problem... dunno...

thanx to one and all for your kind patience

Bob "A"


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

What is the name of the main Signature System's Product?  

Comments:

Optional Link URL:
Link Title:
Optional Image URL:

You may attach up to 5 files to your followup (see below):





Each file can be a maximum of 1MB in length Uploaded files will be purged from the server on a regular basis.


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]