[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 264: mysqli_fetch_assoc(): Couldn't fetch mysqli_result [phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 326: mysqli_free_result(): Couldn't fetch mysqli_result [phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4149: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3027) [phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4149: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3027) [phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4149: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3027) [phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4149: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3027) COMMON SHARE an array? - Pete's QBASIC Site
I've been working on a small game project for a year or two, in good ol QB45. Just recently I went over the 64kb limit and had to start dividing up my code into modules. Here's a rough summary of the problem:
'FILE1.BAS
DIM SHARED INV$(20)
DIM SHARED FLAG$(25)
'FILE2.BAS
COMMON SHARED INV$()
COMMON SHARED FLAG$()
LET FLAG$(0) = ""
PRINT UBOUND(INV$)
The error comes with file2- both the LET and UBOUND return 'subscript out of range,' presumably because COMMON SHARED doesn't dimension a variable. I've never messed with modular programming before, can someone help point me in the right direction?
Thanks for the quick response! I think I'm getting it-- COMMON SHARED has to be included in both BAS files, and in the case of arrays, written out before DIM SHARED in the main module. This: