×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

QBasic "Out of Memory" Need some tech help.

QBasic "Out of Memory" Need some tech help.

QBasic "Out of Memory" Need some tech help.

(OP)
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.

RE: QBasic "Out of Memory" Need some tech help.

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.

http://basic.mindteq.com/

http://www.freeprogrammingresources.com/basic.html

The FreeBASIC compiler claims to be very similar to QB:

http://www.freebasic.net/index.php/download

Lee

RE: QBasic "Out of Memory" Need some tech help.

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.

RE: QBasic "Out of Memory" Need some tech help.

(OP)
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?

RE: QBasic "Out of Memory" Need some tech help.

You could conserve memory (for running) some by using Select Case rather than the list of If statements, too.

Lee

RE: QBasic "Out of Memory" Need some tech help.

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:
http://www.tek-tips.com/viewthread.cfm?qid=464118

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close