Article ID: 61344 - Last Review: November 21, 2006 - Revision: 1.2 Why a Program Might Hang with BLOAD/BSAVEThis article was previously published under Q61344 On This PageSUMMARY
There are two reasons a program might hang when using the BLOAD
statement in Microsoft QuickBasic. First, it is possible to hang your
computer by BLOADing to the incorrect area in memory. Second, if the
array you are BLOADing into is not large enough, the computer might
hang or data and code might become corrupt.
MORE INFORMATION
The most common programming error with BLOAD is to BLOAD into an array
and only use the offset value [VARPTR()] of the array. If the array
you BLOAD into is being stored as a far object and you only use the
offset of the variable [VARPTR()], you will write over data in your
DGROUP and possibly some of your code, and if you are using QB.EXE,
you could write over the code for the editor. To avoid this problem,
always use the VARSEG function to get the segment of the array and
then invoke a DEF SEG beforehand to set the current segment to the one
containing the array variable. This ensures that the data will go into
the correct memory location, whether the array is being stored as a
near or far object.
The second programming error is to BLOAD into a data-item that is smaller than the one that was used to BSAVE the data. This is similar to the error above in that this might cause you to write over both code and data in memory. Both of these programming errors can cause a variety of problems, as follows:
Code ExamplesAPPLIES TO
| Article Translations
|


Back to the top
