BBS: Inland Empire Archive
Date: 07-26-92 (01:51)             Number: 200
From: RAYMOND KEITH                Refer#: NONE
  To: ALL                           Recvd: NO  
Subj: COMMON SHARED /QBug?/          Conf: (2) Quik_Bas
The following common shared method is noted as valid in my reference manuals
however I noticed a nasty bug using this method. It appears to be a random
bug which ocasionaly locks up your computer tight. It is NOT random though,
and can be reproduced consistantly time after time, ONCE you know what's
causing it. The random appearance can make locating this bug frustrating so
I thought I'd post it for those of you who were unaware.

(Main Program)
COMMON SHARED /SubProgram1/ Test1$, Test2$
COMMON SHARED /SubProgram2/ Test3$, Test4$

(Sub Program 1)
COMMON SHARED /SubProgram1/ Test1$, Test2$

(Sub Program 2)
COMMON SHARED /SubProgram2/ Test3$, Test4$

Note: The main program has both common shared blocks, but each subprogram
has only the common shared block it needs. This is shown as valid in my
reference manuals and will run and compile without error or locking up,
except when....

This bug is triggered by where in your program you happen to be when you
save your program. If you are editing in the main program, or a subroutine
of the main program, or make a change in one of your subprograms, but first
move back to the main program before saving the changes, then no problems

If however you make a change to a subprogram or routine, even simply adding
a blank line by pressing Enter, AND save the program while your still in
the subprogram or routine, your computer is now primed to lockup. At this
point you can run your program and it will appear to run and exit fine.
However some part of memory QuickBasic uses just got corrupted. If you try
to run your program again, or save the file again, you will instantly lock
up your computer. I tested this dozens of times and EVERY time I saved my
program while I was within the subprogram or routine, it locked up as
described above.

THE FIX: I went back and placed all the common shared blocks I had in my main
program into each of the subprograms and this problem vaporized. With the
common shared statements the same throughout, you can edit and save anywhere
you want and never lockup the computer.

CONCLUSION: This was a very odd bug, and I stumbled upon its discovery. I had
experienced this seemingly random lockup for a couple of weeks before
tracking it down. Hopefully this may save those of you using the common
shared statements some agrivation.


--- D'Bridge 1.30/003468
 * Origin: Real Estate N.W. BBS Files,Doors,(503)654-5054 24hrs (1:105/224)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET