home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
basic
/
library
/
pb
/
library2
/
pubvars.doc
< prev
next >
Wrap
Text File
|
1990-05-12
|
1KB
|
30 lines
When your POWER-BASIC units contain EXTERNAL variables, you have to declare
them all PUBLIC in the main file. This utility does it for me! The output
file is a tidy alphabetized list of these variables, to be $INCLUDE'ed in
the main file. No more ERROR 503's !!
5-12-90: Just as soon as I uploaded this, I knew I had to improve on it.
Now it gets the name of your MAIN program file, searches it for the $LINK
statements, converts the filenames from *.PBU to *.BAS, opens each of them
in turn to be searched for EXTERNAL statements. It makes a backup of any
prior Public Variables List (*.PV) that it finds, but it won't overwrite
anything without your OK.
In a main program, I found it necessary to do things in a particular order:
DIM Statements for public arrays first, then $LINK statements, then PUBLIC
statements.
Part of the fun of writing this was using many of the new statements Bob
has added. (I'm amazed by the fact that he single-handedly wrote
Turbo/PowerBasic!) I did have some trouble with ON ERROR jumps, so I
included a function called EXIST to check for files
IF EXIST (FileName$) THEN ...
It's a useful little extension.
So here it is -- the New Improved Version!