! ISMBUG.BAS --- bug in XCALL IREAD (use with ISMBUG.CMD) ! IREAD does not wait for record if an ISAM file is opened WAIT'RECORD ! Bob Fowler, Applied Systems Research, 1994-Oct-17 ! To demonstrate problem: ! (1) execute ISMBUG.CMD first ! (2) RUN ISMBUG.RUN on JOB1 to add new key ! (3) RUN ISMBUG.RUN on JOB1 to lock new key ! (4) RUN ISMBUG.RUN on JOB2 to attempt lock on new key ! Step (4) should halt and wait for JOB1, but instead returns ISMERR=29 ! Other pertinent notes: ! --- Chris Hunter has IREAD.SBR patch, so that it works with BASIC 1.4 ! --- leave for Mike Talbutt at AM via AMTEC ! --- did IREAD "break" in AMOS 2.2(451)-9? earlier? always this way? MAP1 ISMCHN,F,6, 10 MAP1 ISMKEY,S,5, "ABCDE" MAP1 RELKEY,F,6 MAP1 ISM'READSPCLOCK,F,6, -1 MAP1 ISMBUF,S,100, "ABCDE" MAP1 ISMERR,F,6 OPEN #ISMCHN,"ISMBUG",INDEXED,100,RELKEY,WAIT'FILE,WAIT'RECORD PRINT "LOOK UP KEY" ISAM #ISMCHN, 1, ISMKEY IF ERF(ISMCHN) = 0 THEN GOTO EXISTS ! 1st time through this program - JOB1 creates data record IF ERF(ISMCHN) # 33 THEN PRINT "ERF"; ERF(ISMCHN) : END PRINT "ADDING KEY" ISAM #ISMCHN, 5, ISMKEY WRITEL #ISMCHN, ISMBUF ISAM #ISMCHN, 3, ISMKEY END EXISTS: PRINT "LOCK KEY" XCALL IREAD, ISMCHN, ISMBUF, ISMERR, ISM'READSPCLOCK ! 3rd time through this program - JOB2 does NOT wait for JOB1 to let go PRINT "ISMERR"; ISMERR ! 2nd time through this program - JOB1 reads/locks record and halts for ... INPUT "Hit return to continue ... ", ISMERR END