Switch to desktop version  
OPEN EBD file config.txt in text mode error - Printable Version

+- Ewon Technical Forum (https://techforum.ewon.biz)
+-- Forum: Development (https://techforum.ewon.biz/forum-50.html)
+--- Forum: BASIC Script (https://techforum.ewon.biz/forum-52.html)
+--- Thread: OPEN EBD file config.txt in text mode error (/thread-2865.html)



OPEN EBD file config.txt in text mode error - mickaa - 18-05-2026

Hi,

When i open a file config.txt with EBD in binary mode, i don't have error, 
Code:
OPEN "exp:$dtCF $ftB" FOR BINARY INPUT AS 1
$ReadNext:
IF EOF $FileNumber% THEN GOTO $ReadDone ENDIF
$Char$=GET 1,1
print $Char$

Console: Read binary file ok

but, when i open a file config.txt with EBD in TEXT mode: i obtain this error: why?
Code:
OPEN "exp:$dtCF $ftT" FOR TEXT INPUT AS 1
$ReadNext:
IF EOF $FileNumber% THEN GOTO $ReadDone ENDIF
$Char$=GET 1,1
print $Char$

Console: Read text file ok

But if i read a many caractere at the same time, it work!
Code:
OPEN "exp:$dtCF $ftT" FOR TEXT INPUT AS 1
$ReadNext:
IF EOF $FileNumber% THEN GOTO $ReadDone ENDIF
$DATA$=GET 1,2048
print $DATA$

Console: Read DATA file OK



RE: OPEN EBD file config.txt in text mode error - mickaa - 18-05-2026

(18-05-2026, 01:04 PM)mickaa Wrote: Hi,

When i open a file config.txt with EBD in binary mode, i don't have error, 
Code:
OPEN "exp:$dtCF $ftB" FOR BINARY INPUT AS 1
$ReadNext:
IF EOF $FileNumber% THEN GOTO $ReadDone ENDIF
$Char$=GET 1,1
print $Char$

Console: Read binary file ok

but, when i open a file config.txt with EBD in TEXT mode: i obtain this error: why?
Code:
OPEN "exp:$dtCF $ftT" FOR TEXT INPUT AS 1
$ReadNext:
IF EOF $FileNumber% THEN GOTO $ReadDone ENDIF
$Char$=GET 1,1
print $Char$

Console: Read text file ok

But if i read a many caractere at the same time, it work!
Code:
OPEN "exp:$dtCF $ftT" FOR TEXT INPUT AS 1
$ReadNext:
IF EOF $FileNumber% THEN GOTO $ReadDone ENDIF
$DATA$=GET 1,2048
print $DATA$

Console: Read DATA file OK


Okay, I understand. It's not possible to read an EBD file char by char if that file isn't in /usr/...