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.
Output:
The whole line is the following:
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?
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?