Posts: 23
Threads: 12
Joined: Jul 2003
Hi, I have making a game and his source bas file size is only 40KB and it works with no problems in QuickBasic itself but when trying to make an EXE file of it, it's Sounds A Beep
and Writes the following Error:
Bc Out Memory
45880 Bytes Available
2 Bytes Free
0 Warning Errors(s)
1 Sereve Error(s)
Even In QuickBasic 4.5 it does the same.
What should I do?
Posts: 2,765
Threads: 138
Joined: Nov 2002
Uhm What's your OS? Try quiting a few running programs and run in fullscreen.
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 23
Threads: 12
Joined: Jul 2003
First of all, I'm using MS-DOS 6.22
and Second, I have Enough Memory (Like 46MB Free Ram)
So any other Suggestions?
Posts: 3,522
Threads: 189
Joined: Dec 2003
Note: Free memory is not free RAM, free memory is free conventional memory. (Which is limited to 640KB, so max would be that, not that you can possibly get max, but anyways)
When you try to compile, the QB IDE calls BC and then LINK
Those programs have to fit in memory (each at a time) alongside your code, and QB.
And as you can see, when BC starts it tells you taht you have:
45880 Bytes Available
That is the free amount of mem you have, BEFORE BC starts to compile your BAS.
If your BAS is ~40KB (For ease, let's assume: 40kb=40000bytes)
Then you're left with 5000bytes, for BC to keep variables and all other stuff neded in compile time.
Not enough in other words.
Try compiling from the commandline, or free some memory, check your CONFIG.SYS, and AUTOEXEC.BAT and don't load any un-needed stuff.
Posts: 3,616
Threads: 287
Joined: Jan 2003
I'm uneducated when it comes to this - but couldn't you try right-clicking on BC.EXE, going into Properties, then the Memory tab, and increasing the Conventional Mem property by, say, 40 KB?
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 1,774
Threads: 62
Joined: Aug 2003
I think the easiest way is to hit Ctrl-Alt-Del and end everything except explorer and systray.
Posts: 594
Threads: 11
Joined: Oct 2002
He IS in DOS!!!
There is no systray or explorer...keep in mind!!!
B 4 EVER
Posts: 3,522
Threads: 189
Joined: Dec 2003
Correction to my previous post, BC is limited to 64KB memory, at a time, not 640KB which is the computer hardware limit for conventional memory.
Try dividing your code into modules, if you don't want to compile from the command line that is.
Commandline works when the IDE fails =)
Posts: 23
Threads: 12
Joined: Jul 2003
I have found the Solution
!!!
Thanks for the idea Z!re about Modules it can help me if my game will be extremly large... but the real problem
was ONLY in TWO SIMPLE lines which are:
part of the game in SUB
NewObject.X = X * TILEW
NewObject.Y = Y * TILEH
The Two Problematic lines in the same SUB :
NewObject.Dx = NewObject.X + INT(RND * 21) - 10
NewObject.Dy = NewObject.Y + INT(RND * 21) - 10
I changed it into:
NewObject.Dx = X * TILEW + INT(RND * 21) - 10
NewObject.Dy = Y * TILEW + INT(RND * 21) - 10
And suddenly I could actually Complie the program with ease
and seen that I have really enough memory for the source ( something like 31000 Bytes)
still can't understand why this two lines caused to lower memory
to something like 2 Bytes Free?
That is really wired :???: