|
Frank, I take it that the program crashes on the line that increases KF_LINE. Your comment suggests that KF_LINE is a 3-digit field, so that would mean that the actual value is 999. That can only happen if the actual value of FILEKEY15 exists in FILE15. My guess is that either your key definition is incorrect (is KF_LINE part of FILEKEY15) or there is a record with 999 lines of notes. The latter is easily checked with SQL: select group_field, max(line) from FILE15 group by group_field order by 2 desc. BTW: There is a simpler way to find the highest line: C EVAL KF_LINE = *HIVAL C FILEKEY15 SETLL FILE15 C group_field READPE FILE15 C IF %eof(FILE15) C* No lines yet; start with 1 C EVAL LINE = 1 C ELSE C IF LINE = 999 C* Oops, full; maybe some error signaling C ELSE C* Add 1 to highest line C EVAL LINE = LINE + 1 C ENDIF C ENDIF Joep Beckeringh
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.