Appears to be a bug here.GET$#F% (on all platforms) should return an empty string at EOF, and if it's not doing so it's a bug.
Used program 1 to create the fault, only took 1 minute before M% started to go wild.
Used program 2 to find where the fault started, C% counted to 542.
Used program 3 to save the ascii codes around that point.
I have the file if by any chance you can't reproduce the error.
Svein
Edit: prog 2 and 3 updated
Code: Select all
f$=@tmp$+"test.txt"
REPEAT
F%=OPENOUT f$
IF F%=0 THEN ERROR 0,"can't create file"
L%=RND(1000)
FOR I%=0 TO L%
BPUT#F%,RND(255)
NEXT
CLOSE#F%
F%=OPENIN f$
IF F%=0 THEN ERROR 0,"can't open file"
N%=0 : M%=0
REPEAT
REPEAT
a$=GET$#F%
M%+=1
UNTIL a$<>""
N%+=1
UNTIL EOF#F%
CLOSE#F%
PRINT L%,M%,N%
UNTIL M%>L%
REM N%=6 L%=548 M%=50851547
Code: Select all
f$=@tmp$+"test.txt"
REPEAT
F%=OPENIN f$
IF F%=0 THEN ERROR 0,"can't open file"
N%=0 : M%=0
C%=0
REPEAT
REPEAT
a$=GET$#F%
M%+=1
UNTIL a$<>""
N%+=1
FOR B%=1 TO LEN(a$)
PRINT ASCMID$(a$,B%);" ";
C%+=1
NEXT
UNTIL EOF#F%
CLOSE#F%
PRINT L%,M%,N%
UNTIL M%>L%
REM C%=542
Code: Select all
f$=@tmp$+"test.txt"
F%=OPENIN f$
IF F%=0 THEN ERROR 0,"can't open file"
G%=OPENOUT (@tmp$+"ascii.txt")
IF G%=0 THEN ERROR 0,"can't save"
FOR A%=500 TO 600
B%=BGET#F%
a$=STR$A%+" "+STR$B%
PRINT#G%,a$ : BPUT#G%,10
NEXT
CLOSE#F%
CLOSE#G%
Code: Select all
500 214
501 87
502 158
503 123
504 138
505 224
506 159
507 95
508 28
509 10
510 170
511 95
512 214
513 168
514 31
515 155
516 228
517 211
518 29
519 153
520 236
521 86
522 105
523 191
524 54
525 211
526 52
527 70
528 118
529 77
530 36
531 140
532 111
533 184
534 38
535 21
536 122
537 120
538 216
539 174
540 108
541 105
542 57
543 38
544 217
545 110
546 87
547 82
548 105
549 249
550 231
551 99
552 5
553 203
554 153
555 120
556 35
557 229
558 180
559 127
560 32
561 155
562 230
563 121
564 91
565 78
566 52
567 254
568 180
569 25
570 34
571 115
572 62
573 180
574 250
575 79
576 78
577 173
578 231
579 98
580 100
581 248
582 145
583 30
584 96
585 31
586 34
587 229
588 231
589 113
590 115
591 79
592 138
593 189
594 184
595 142
596 121
597 148
598 82
599 105
600 223