Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

any tips on slimming?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
i am making a game and i already reached the 64k limit, dumped a bunch of data into a seperate file, got rid of my data statements, changed "read" to "input", to get the data from the file, and am again aproaching 64k. i need to lose weight! any tips?
thx in advance, -zazzafunk
 
You could use DECLARE SUBs for some repetitive tasks. I've sometimes placed my intro screens in a SUB too, I know the program will usually call it once (at startup) but it keeps my main code a little more cleaner. Actually if you happen to have the OEM of v4.5 there's a QCARD.BAS file--you need to complete with the manual to get it going, but anyway--if you look at the listing of the SUBS there's quite a few of them.

You could also try to indicate which numeric variable are integers (if you have a mix of integers and Floaters). If I'm not mistaken, I believe that QB makes an unsigned numeric variable into a SINGLE variable by default unless you specify it to be an integer. (see HELP files > CONTENTS > DATA TYPES)

And the last thing, I can mention is to load QB with the access high command, like... QB.EXE /AH to give any arrays you may have some place to go other than conventional memory.

Anyone else??

-MiggyD
[sig]<p> <br><a href=mailto: > </a><br><a href= > </a><br>English is too hard to learn, the vowles change too much like come/home, comb/tomb, book/school, high/bye/sty, etc., etc. So should I say Geez or Sheez or Cheeze? hehe.[/sig]
 
Just thought I'd point out that the /AH flag for QB doesn't actually give arrays more space, it simply allows them to cross segment boundaries, reducing the granularity of memory. Arrays still go into data memory, which is 2 segments distinct from code memory's single segment per module. DATA statements are effectively code, and as such, they also use up code memory, so getting rid of DATA statements was a good move. The only other way to reduce code size is simply to optimize it for size, which is an art, more than a science. The most important thing is to remember that your design choices are not completely set in stone, and that you can rethink the way you're doing certain things and recode them if necessary. If there is a way that you can use the same code in more than one place, or even eliminate code entirely, then by all means, do so. [sig][/sig]
 
Look under QB help for details on the CHAIN command. It will require a bit of work but this is a good option to explore when you have a lot of code to run and very little room to run it in.
[sig]<p> <br><a href=mailto: > </a><br><a href= plain black box</a><br><i>"I'm all right now, Dave. Really, I am."<br>
<b>HAL, </i><u>2001 a Space Odyssey</u></b><br>
<br>
[/sig]
 
logiclrd,
You know. I kept looking at my last response (the /ah command) and couldn't place my finger on why it was bothering me. Thanks for the observation. Also, you're right that it's more of an &quot;art form&quot; than straight through procedures/coding.

Alt255,
Glad you mentioned chaining. I'd like to add that a common file should be available to all modules. You may want to have an $INCLUDE statment in each module so that there is little room for typographical errors or other discrepencies like filename(s) not found and such.

--MiggyD [sig]<p> <br><a href=mailto: > </a><br><a href= > </a><br>English is too hard to learn, the vowles change too much like come/home, comb/tomb, book/school, high/bye/sty, etc., etc. So should I say Geez or Sheez or Cheeze? hehe.[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top