How to supress the end of file character

April 7, 2010 at 21:24:24
Specs: MS-DOS
I use GWBASIC program to create web page content, but keep on getting a square character at the end, after using the OPEN "O" keyword.

Problem is when that file is then run as a Javascript or PHP application, the program will crash because of this end of file character.

I need to find a way to use the OPEN "O" keyword, but not have that end of file character appear in the file.

Currently, I need to open the file in MS-Notepad, and cut out the character.

See More: How to supress the end of file character

Report •

April 7, 2010 at 21:55:01
you prob'ly need to open the file as binary, which allows more control of output:
open "xx" for binary access write as #1
dim x as string * 1
'---then you need to "put" single-byte variables until close:
put #1,,x
'---- end
also, i'm going from Qbasic, haven't had a chance to see if GWBASIC works the same...
(re gwbasic: "... i haven't heard that name in a loong, loong time"
(quote obi wan, to Luke).)
Other way is just create the file normal,close, open file for append, seek #1,-1, (basically seek eof -1), then close the file, effectively performing an end-ofile-ectomy.

Report •

April 8, 2010 at 03:32:17

copy /A YourFile /B > nul
del YourFile
ren YourFile

Report •

April 8, 2010 at 06:42:30
excellent! i keep forgetting about that copy binary...
much better.

Report •
Related Solutions

Ask Question