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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BINDING??? When I start my program it freezes and says binding!

Status
Not open for further replies.

xangel

Programmer
Mar 25, 2002
1
US
Whenever I run my program, Qbasic freezes and it displays "binding" at the bottom of the qbasic screen. I already tried breakpoints, and it turns out that the program doesn't even start! i made sure all of my declares are right at the beggining. If their is anything you know that could help me, please reply. The program is for a major school project.
Thank you.
 
Binding means that Qbasic is just putting it all together so that it can run it. If it is freezing, then there is something wrong with qbasic. Try scanning it w/ SCANDISK and your virus scanner.
Also try running it on a different computer, if it doesn't run then, then it is your program. Also try it on an earlier version of Windows (the earlier the better)
 
QBASIC stores your code in a tokenized bytecode format. Every time you enter a line into the IDE (or modify an existing one), it recompiles the bytecode for that line. This allows it to execute more quickly than if it had to parse the text at runtime.

When you load a program in, it has to do this compile process for every single line, as though you were typing the entire program in from scratch really quickly. Since on older computers, this would often take a while, they made QBASIC periodically update the status bar while it was processing. This is what the 'Loading & Binding' message is all about.

Now, again since on older computers the binding took a long time, the binary file format was introduced, which stores the bytecode for each line, along with formatting information that allows the original line to be reproduced by expanding the bytecode. However, the binary format has little error checking; it assumes the bytecode is valid, that the file is good. If the file is damaged, then it will most likely freeze while loading, since it is trying to reconstruct those bytecode structures from the file and the file is giving it bogus information.

I have seen (external) programs that convert the binary format into text format, kind of like QBASIC except with error checking. I don't remember where I last saw them, it must have been at least 3 or 4 years ago, but I'd say one of these is your best bet. Other than that, the unfortunate truth is that your code is essentially lost. The only way around the problem is to not use the binary format in the first place. The 'Save As' dialog allows you to pick between the binary format and the plain text format.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top