Author Topic: Another feature that can improve /expand QB64IDE .... managing txt files...  (Read 2079 times)

0 Members and 1 Guest are viewing this topic.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Hi Guys

it seems to me that the old Qbasic and QB were able to load and manage txt files that are well managed also from other programs.
I'll suggest to add this option to QB64IDE because for the state of art today it is not possible.... it seems that saving the file QB64IDE adds something at the end of file that is not visible if you open the same file by notepad.exe but it is visible to EOF() keyword of Qbasic

see here for details
https://www.qb64.org/forum/index.php?topic=2442.msg116685#msg116685

Thanks to read

Ps In Qbasic there is no difference in the mask of saving file and Qbasic saves a simple txt file. For Now QB64 doesn't it!
In QB there are different options in File pulldown menu like Save and Save as... that let you choose how to save your program (bitcode of Qb vs Txt file)  and Create File... Load file...  in which you can choose among Module / Include/ Document.

Programming isn't difficult, only it's  consuming time and coffee

Offline EricE

  • Forum Regular
  • Posts: 114
    • View Profile
Hi TempodiBasic.

I used a hex editor named "FlexHex" (it is free!) to examine some source files saved by the QB64 IDE.
Only CRLF character pairs were found at the end of the file that I looked at.

Here is a link to the FlexHex web page so you can use it to examine source files saved by the IDE.

The Hex Editor That Can Do More
FlexHEX is a full-featured hex editor designed to edit binary files, OLE compound files, logical devices, and physical drives.
With FlexHEX you can inspect, modify, insert, search, or replace binary, ASCII, or UNICODE data.
http://www.flexhex.com/
 

Offline Bert22306

  • Forum Regular
  • Posts: 206
    • View Profile
Tempo, I'm not sure what you are describing. In my case, I can open any .bas file I wrote in notepad or wordpad, and I can also use the old fashioned command line approach, go to the directory where my .bas files are, and "type" them to the screen, as if we were back in DOS days. They show up fine.

Could this be a problem with Linux? Are you using Linux?

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
@EricE  thanks to confirm my hypothesis together Ashish!

@Bert22306 sorry for my bad communication: the issue is if I write something and not code and I want save it as simple text file the QB64IDE adds at the end of it CFRL. As in the thread linked I have used QB64IDE like a text editor to paste and save the 2 maps... but then running the program I got an EOF error  "read past end of file" ??? Why? Simply because there is the CFRL added as another character so EOF returned 0 but at the next reading it activates the runtime error.
I was able to let work the Prithak demo just when I create for the second time the data files using Notepad.exe of windows.
So I think it has been added something to the data in the process to save it as file of text by QB64IDE. And it seems to me that different IDE let save txt file with no modifications, and if I remember well also the QB45 and Qbasic.
Not a must but a feature in the list of completeness of IDE can be the option or menu command Save as Txt.

Nothing more

No this experience has been done in that wonderful OS that is Windows10

Thanks to read
Programming isn't difficult, only it's  consuming time and coffee