My program produces an error 6 overflow on occassion. The address points to
the first line of code in the following SUB, I have a diagnostic routine that writes all the variables to an
error log, they look fine. The program is not compiled with DEBUG.
I assume the error is somewhere within this SUB. I am using PBDOS comipiler 3.5.
Any idea how I can isolate the error. Compiling with debug prodruces Too big an EXE.
SUB CusStoreRecord
DIM F AS LOCAL INTEGER
DIM EdStr AS LOCAL STRING
DIM S AS local string
=>EdStr=CusStreet+CusCity+CusState+MKL$(CusZip)+MKQ$(CusTel)+_
MKL$(CusDate)+CusMemo1+CusMemo2+MKL$(CusBalance)+_
MKL$(CusLimit)+MKI$(CusStatus)+CusExtra1+CusExtra2
If Len(EdStr)<>180 then
CusCity = Left$(CusCity,12)
CusState = Left$(CusState,2)
CusMemo1 = Left$(CusMemo1,40)
CusMemo2 = Left$(CusMemo2,40)
CusExtra1 = Left$(CusExtra1,20)
CusExtra2 = Left$(CusExtra2,20)
CusStreet = Left$(CusStreet,20)
EdStr=CusStreet+CusCity+CusState+MKL$(CusZip)+MKQ$(CusTel)+_
MKL$(CusDate)+CusMemo1+CusMemo2+MKL$(CusBalance)+_
MKL$(CusLimit)+MKI$(CusStatus)+CusExtra1+CusExtra2
End If
IF Len(EdStr) <> 180 THEN
PRINT "JAMIE, IT DOESN'T WORK."
STOP
END IF
CALL OpenNetFile(DataDIR+"CusAcnt.DAT","BW",F,%True,0)
If CusRecord Then
Seek #F,(CusRecord-1)*5
Else
Seek #F,LOF(F)
CusRecord=LOF(F)/5+1
End If
Put$ #F,"|"+MKL$(CusAccount)
Close #F
CALL OpenNetFile(DataDIR+"CusName.DAT","BW",F,%True,0)
Seek #F,(CusRecord-1)*17
Put$ #F,"|"+CusName
Close #F
CALL OpenNetFile(DataDIR+"Customer.DAT","BW",F,%True,0)
Seek #F,(CusRecord-1)*180
Put$ #F,EdStr
Close #F
End SUB
$
------------------
the first line of code in the following SUB, I have a diagnostic routine that writes all the variables to an
error log, they look fine. The program is not compiled with DEBUG.
I assume the error is somewhere within this SUB. I am using PBDOS comipiler 3.5.
Any idea how I can isolate the error. Compiling with debug prodruces Too big an EXE.
SUB CusStoreRecord
DIM F AS LOCAL INTEGER
DIM EdStr AS LOCAL STRING
DIM S AS local string
=>EdStr=CusStreet+CusCity+CusState+MKL$(CusZip)+MKQ$(CusTel)+_
MKL$(CusDate)+CusMemo1+CusMemo2+MKL$(CusBalance)+_
MKL$(CusLimit)+MKI$(CusStatus)+CusExtra1+CusExtra2
If Len(EdStr)<>180 then
CusCity = Left$(CusCity,12)
CusState = Left$(CusState,2)
CusMemo1 = Left$(CusMemo1,40)
CusMemo2 = Left$(CusMemo2,40)
CusExtra1 = Left$(CusExtra1,20)
CusExtra2 = Left$(CusExtra2,20)
CusStreet = Left$(CusStreet,20)
EdStr=CusStreet+CusCity+CusState+MKL$(CusZip)+MKQ$(CusTel)+_
MKL$(CusDate)+CusMemo1+CusMemo2+MKL$(CusBalance)+_
MKL$(CusLimit)+MKI$(CusStatus)+CusExtra1+CusExtra2
End If
IF Len(EdStr) <> 180 THEN
PRINT "JAMIE, IT DOESN'T WORK."
STOP
END IF
CALL OpenNetFile(DataDIR+"CusAcnt.DAT","BW",F,%True,0)
If CusRecord Then
Seek #F,(CusRecord-1)*5
Else
Seek #F,LOF(F)
CusRecord=LOF(F)/5+1
End If
Put$ #F,"|"+MKL$(CusAccount)
Close #F
CALL OpenNetFile(DataDIR+"CusName.DAT","BW",F,%True,0)
Seek #F,(CusRecord-1)*17
Put$ #F,"|"+CusName
Close #F
CALL OpenNetFile(DataDIR+"Customer.DAT","BW",F,%True,0)
Seek #F,(CusRecord-1)*180
Put$ #F,EdStr
Close #F
End SUB
$
------------------
Comment