In AREV (and GREV, for that matter), we've always had to use a code snippet like the following to solve an RTP57 run-time error problem on OSBREAD / OSBWRITE:
The problem manifests itself with the modulo of the byte offset for read/write operations (65536) is 21930.
FOOBAR=MOD(BYTE.POS,65536)
IF FOOBAR=21930 THEN
BYTE.POS-=1 ;* decrement by oneOSBREAD BYTE FROM FVAR AT BYTE.POS LENGTH 1 ;* read a byteOUTPUT.REC=BYTE:OUTPUT.REC ;* tack it to the headEND
OSBWRITE OUTPUT.REC ON FVAR AT BYTE.POS
BYTE.POS+=LEN(OUTPUT.REC)
Is this still required in OI??
Don Miller
Don,
Wouldn't be surprised if the 21930 bug is still there.
Can you write program to check?
Steve
Steve .. will do and report back.
Don M.
The bug is dead!! Long live OI. This used to be a genuine headache when writing import/export programs. The offset I used was 87466 which MOD(65536) is 21930. No longer is the following needed:
FOOBAR=MOD(BYTE.POS1,65536)
IF FOOBAR=21930 THEN
BYTE.POS1-=1OSBREAD BYTE FROM FVAR AT BYTE.POS1 LENGTH 1OUTPUT.REC1=BYTE:OUTPUT.REC1END
Don M.