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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

QBasic "Out of Memory" Need some tech help.

Status
Not open for further replies.

mdabber

Technical User
Feb 9, 2006
2
0
0
US
I have read the following thread and it was helpful:
thread314-1047741
Not sure how to do this:

I am scoring a psychological measure. There are different percentile scores based on raw scores that vary by age and gender. I have input statements for all the questions. I then have qbasic go to subs based on age and gender to retrieve their % rank (2 genders, 5 age ranges = 10 different sub routines). It gets WAY too big. There are thousands of % I have entered in these subroutines and I run out of memory. How do I put each of these subroutines in seperate files and call each of these seperate programs so I don't run out of memory? I have put so much time in entering these values, I really would love to see it work out. Thanks.
 
Have you considered another language that would be easy to port your QB code to? The more modern ones don't have the memory restrictions that QB does.

Here are some websites with a wide variety of BASIC and BASIC-like languages, many available for free.



The FreeBASIC compiler claims to be very similar to QB:


Lee
 
1) have you tried another version of Qbasic?
Quick Basic 4 or 4.5 if you used Qbasic 1.1 before?
2) have you tried to split your program in parts and use CHAIN
(as far as I understand it's a program that don't fit in memory)
3) If you cannot | don't want to rewrite your program you can try another compiler
4) but it seems that you have lot's of data ("thousands of %") in your code. Could you possibly separate that data into tables | files and make some more general code?

Though I could be wrong. After all, I haven't seen any of the code.
 
Basically I have those 10 subs that look something like this:

IF A = 0 THEN AT = 41
IF A = 1 THEN AT = 43
IF A = 2 THEN AT = 46
IF A = 3 THEN AT = 51
etc.

There are scales A-N in each of the 10 subs, most running from 0 to 25, some 0 to 50+

Can I put each BIG subs into seperate files and then call these files from the main file? If so, how does that syntax look?
 
You could conserve memory (for running) some by using Select Case rather than the list of If statements, too.

Lee
 
I never (or almost) used CHAIN myself, but this just worked
(calling a prog from other one and passing variables between):
first prog:
Code:
COMMON SHARED n, a$
a$ = "khkhkjh"
n = 13
PRINT "In the #1"
PRINT "n="; n
PRINT "a="; a$
PRINT FRE(0), FRE(-1), FRE(-2)
CHAIN "testch2.bas"
second prog (called testch2.bas)
Code:
COMMON n, a$
PRINT "In the #2"
PRINT "n="; n
PRINT "a="; a$
PRINT FRE(0), FRE(-1), FRE(-2)

Also you can look at this thread:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top