Bug found: →
#4
PB 3.5 uses DOS-functions to get a files length.
I think, for speeding things up, PB 3.5 does not check, if ASCII Code 26 is inside of a file or at the end.
I wrote a small test.
Code:
$If 0
  Test zum Interpretieren       Test for interpreting the
  des ASCII-Zeichens 26.        ASCII character 26.
  PB 3.5 beendet das Lesen      PB 3.5 terminates the
  einer Datei, wenn dieses      reading of a file if this
  auftritt, sowohl die IDE      occurs, both the IDE and
  als auch der                  the command line compiler.
  Kommandozeilencompiler.       How does
  Wie reagiert                  Line Input, #iFile
  Line Input, #iDatei?          react?
$EndIf


$Dim All
$Lib All Off

Dim sFile As String , _                ' Name if File
    sText As String , _                ' Line of Text from sFile
    sTest As String , _                ' Last read text from sFile
    iFile As Integer, _                ' PB-Filenumber of sFila
    lFile As Long                      ' Number of Read Bytes (binary!)

sFile = "ifenantw.inc"
iFile = Freefile
lFile = 0
sTest = "$EndIf"

Open sFile For Input As #iFile

  Print "Length of ";sFile":";Lof(iFile)
  Shell "Dir "+ sFile

  Do:Loop Until Len(Inkey$)

  While Not Instr(sText,sTest)
    Print Using$("Read: ###### Bytes: ",lFile);
    Line Input #iFile, sText
    Incr lFile, Len(sText)            ' Add read textlength
    Print sText
    Incr lFile, 2                      ' Dos: Cr+Lf = 2 Byte for a new Line
  Wend

Close iFile


Output:
Quote:    D:\…\ascii26
    Length of ifenantw.inc: 20705
    Volume in drive D is (…)
    Directory of D:\…\[name]
    IFENANTW INC        20,705  03-11-25 10:48a
            1 file(s)        20,705 bytes
            0 dir(s)    46,846 Mega bytes free
    (…)
    Read:  1602 Bytes:    zugelassen werden sollen, z.B. ←,
    Read:  1642 Bytes:
    Error 62 at pgm-ctr: 485

The whole line is the following:
Quote:    zugelassen werden sollen, z.B. ←, →CHR$(26 = Pfeil nach rechts) oder Esc

PB-Help says:
    Error 62: Input past end

Good to know, that the Chr$()-function is to be used here.

Have later versions of PB[WIN|CC] got such a "fileterminator", too?
Reply


Messages In This Thread
Bug found: → - by Andy Dee - 03-07-2025, 12:32 PM
RE: Bug found: → - by Eric Pearson - 03-10-2025, 09:00 PM
RE: Bug found: → - by Dale Yarker - 03-11-2025, 03:56 AM
RE: Bug found: → - by Andy Dee - 03-11-2025, 02:58 PM
RE: Bug found: → - by Albert Richheimer - 03-12-2025, 08:22 AM
RE: Bug found: → - by Andy Dee - 03-12-2025, 02:50 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)