Severe Error when making EXE file

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
kc0nfs
Newbie
Posts: 4
Joined: Mon Oct 05, 2009 10:17 pm
Location: Tonganoxie, Kansas
Contact:

Severe Error when making EXE file

Post by kc0nfs »

I have 5 arrays that I have dimensioned.
When I run the EXE compilier I get A Severe Error.
Data Memory Over flow on the 4th DIM statement (DIM SHARED xbox)
It doesn't ever make it to the 5th DIM statement. (see below)
DIM ft$(21) (A string array 21 strings 28 characters length)
DIM deg(21) (A numeral array 2 digit x 21)
DIM Shared box(1 to 16000) (A graphics GET / PUT Array)
DIM Shared xbox(1 to 360) (A numeral varible to the 5th decimal place)
DIM Shared box2(1 to 16000) (A graphics GET / PUT Array)

Am I exceeding the memory limits. I tried STATIC DIM SHARED and DYNAMIC DIM SHARED with /AH at the command line.
Am I going to have to make my arrays smaller?
Thanks for any help!
Mark... KC0NFS (ham radio call sign)
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

588 + 42 + 360 + 32000 = 32990

Maximum array size total not including program memory = 32767. Whether Integers or strings. Each integer uses 2 bytes. Strings 1 per length.

YES! You need to use one 16K array if possible. You can BSAVE the box images and BLOAD them when necessary quite fast. Then you only need one 16K array. SAVE that memory! Try to keep image array totals around 26K at most. That is 1/3 of a fullscreen 12 image.

The size of an image array is determined by the screen mode used. Screen 12 requires more than 13 because of the pixel resolution and number of planes (4).
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
kc0nfs
Newbie
Posts: 4
Joined: Mon Oct 05, 2009 10:17 pm
Location: Tonganoxie, Kansas
Contact:

Reply to burger2227 on Severe Error when making EXE file

Post by kc0nfs »

Thanks for the information. I will try out what you suggested. Just FYI, the program runs correctly when in QBasic, but just wouldn't compile.
(and thanks for such a quick response!)
Mark....kc0nfs
Post Reply