Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Qbasic destroying my progarms!

Status
Not open for further replies.

Beholder2

Technical User
Sep 27, 2004
31
US
Has anybody encountered this problem before, they write a program then next time you try to load after restarting qbasic you get 'BAD FILE MODE' even though the file should theoretically be fine? This has happend to me numerous times, i've even re-written my program twice and this keeps happening... I also tried opening it in an editor and all I get is garbage like wingdings..

anyone?
 
Are you saving it as a text file, or letting QBasic save it in tokens?

Lee
 
If you write the program in QuickBasic and save it in fast load mode (tokens), then try to open it in Qbasic this will
happen probably. Qbasic only reads progs saved as text.

Possibly, if you had long lines it could give you trouble
upon reloading it (just a thought).

You can always open it with the dos editor. If it's got
control characters embedded then it was tokenized.
 
I don't understand what you mean by tokenized? the file does have loads of control characters in it now, all i did was just save it as I always do. Then the whole file got screwed up, is there any way to convert it back into a normal file? explain what you mean with these tokens please.
 
I actually thought I was using just qbasic, but no its apparently the quickbasic 4.5 program.
 
If you want to read the code as a text file, then you have to Save As and make sure there's an X in the choice for text - readable by other programs.

Lee
 
ack. Do that I always save it the same way. just the next day when I loaded up the program I get 'bad file mode' !! something is screwy here.. why is this happening.. when i save it correctly
 
To get BAD FILE MODE do the following:

*****************
using NOTEPAD type one line (example: Print "HI") then save the file as TEST1.BAS and TEST2.BAS (make sure .TXT is not the extension)


*****************
> open QB and load TEST1.BAS and type Print "Hi yourself" under the existing line.

> then click FILE>SAVE AS.

> when the "SAVE AS" dialog box shows up, look in the section that says 'FORMAT' and make sure there's a DOT in the option that says 'TEXT - READABLE BY OTHER PROGRAMS'.

> then click on the OK.


*****************
> open QB and load TEST[red]2[/red].BAS and type PRINT "Hi yourself" under the existing line.

> then click FILE>SAVE AS.

> when the "SAVE AS" dialog box shows up, look in the section that says 'FORMAT' and make sure there's a DOT in the option that says 'QUICKBASIC - FAST LOAD AND SAVE'.

> then click on the OK.


*****************
Using NOTEPAD, open TEST1.bas and add a space to the PRINT "Hi" so that it looks like: PRINT " Hi". and save it.

Using NOTEPAD, open TEST2.bas and look for "HI yourself" (the other symbols you see are tokens). Once you find the phrase, add a space to it so that it looks like: "Hi your self" and then save it.


*****************
open QB and load in TEST1.bas -- it should load w/o problems. Now try loading TEST2.bas -- you should get "BAD FILE MODE"


--------------------
Hope this helps answer your question -- some program(s) is modifying your 'quick-saved' BAS file. Worst case: drive starting to crash? Did you install some new software? Is the QB you have an OEM?

--MiggyD

--> It's a bird! It's a plane! No, it's an OS update patch! Ahh!! <--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top