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

Out of String Space

Status
Not open for further replies.

synchsys

Programmer
Aug 25, 2003
4
US
Hi All,

I wrote a system in Qb4.5 some 10 years ago and have been trying to get the most out of it b4 I have to re-write. The problem I am getting is a runtime error 14 (Out string space) on the following command:

Claim$ = MID(Claim$,1,392) + MID$(Claim$,412)

I have many of these untyped on-the-fly variables in sub-modules I have added to the main program. I guess I have reached some kind of limit. Any suggestion? If a pre-define a variable like: "claim as string * 512", would this solve my problem??

Thanks All

synchsys
 
Claim$ = MID(Claim$,1,392) + MID$(Claim$,412)

I am sure is not the problem, your program simply uses too much memory. Try using memory cutting techniques, like ERASEing big arrays when you are done with them, converting everything to an integer that can be.
If you stil get the error, look at my FAQ entitled "64KB of conventional RAM" - or something like that.

Actually sometimes I get an out of string space error, and if I simply save the program it will run.

If a man says something in the forest and no woman hears it is he still wrong?
 
qbasicking,

Thanks for the tip, the Faq's were very helpful!
I didn't realize there were so many people still writing in qb. I will monitor this site as I try to extend my systems usefulness a bit longer.

synchsys
 
synchsys:

I do want to add something about your supposed error line.

1) Sometimes the IDE will stop on the line BEFORE the line that actually causes the error...so you may want to check the next action/line following the one you mentioned above.

2) The line you posted:
Claim$ = MID(Claim$,1,392) + MID$(Claim$,412)
is incorrect. It should read:
Claim$ = MID[red]$[/red](Claim$,1,392) + MID$(Claim$,412).
When I placed the cursor on MID and pressed F1, it was listed as a SINGLE number. When I placed the cursor on MID$ it came back with the help file. So, based on the fact that CLAIM$ is string and you don't have STR$ listed to convert the SINGLE to text, I deduced that MID should have been MID[red]$[/red] instead. If this is incorrect please mention so.

Hope you figure it out.

--MiggyD
 
MiggyD,

You were correct. I really meant MID$
Typing is not one of strong points!

I think I did figure some things out. It was definitely some kind of "out of memory condition". I followed some of qbasicking's suggestions like ERASEing arrays after I was done with them and trying to convert all numerics to integers. It seemed to solve the problem (for now). If I need to add code in the future to this app, we will see what happens then!

This app was written 10 years ago when qbasic 4.5 had just come out. It is a mix of my code, a c-tree style file system written in qb45/asm called etree, and a screen producing product called p-screen also written in qb/asm. The companies who released both products no longer exist, so I was pretty much on my own!

Thanks
synchsys
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top