[Basic] - Memory overflow

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

Post Reply
Treefrog
New Member
Posts: 42
Joined: Mon 11 Jul, 2005 9:31 pm
Location: Here

[Basic] - Memory overflow

Post by Treefrog »

Been working on a menu system for the past week or so, and just got a couple versions finally working. When I scan a lot of entries, however, the calc comes up with a memory shortage, even with a couple thousand in ram. I'm only using an if:then statement, and while hearing about problems, have not yet encountered any until now.

Can I get some help or any informative knowledge? Thanks.
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

ERR:OVERFLOW or ERR:MEMORY?
Image
Treefrog
New Member
Posts: 42
Joined: Mon 11 Jul, 2005 9:31 pm
Location: Here

Post by Treefrog »

Memory
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

Well it has to be what's Ans or that you have too many If statements not closed yet.

Code: Select all

If X=1:Then
something
If A=2:Then
something
If B=3:Then
something
If C=4:Then
...
etc
So it could be a combination of both, since each if statement is about 40 bytes I believe and if your messing with Matrices or Lists that can eat up more memory. And if you don't have much memory to start with then that could add to it.

You can post the code useing this and we can try to help you better.
User avatar
Dwedit
Maxcoderz Staff
Posts: 579
Joined: Wed 15 Dec, 2004 6:06 am
Location: Chicago!
Contact:

Post by Dwedit »

If you GOTO out of an If block, then it leaves junk on some kind of stack, eventually leading to a memory error. You might be able to use an End after a label to get around it, or just make any IF that uses a goto only a single line long.
You know your hexadecimal output routine is broken when it displays the character 'G'.
Treefrog
New Member
Posts: 42
Joined: Mon 11 Jul, 2005 9:31 pm
Location: Here

Post by Treefrog »

I'll post the code when I get back home.

It's in only one IF command, I believe, but does use a lot of list and Ans commands. If I can spot any goto issues, I'll fix that as well.
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

Yes dwedit is correct, I will take a look at the code when I get a chance.
Treefrog
New Member
Posts: 42
Joined: Mon 11 Jul, 2005 9:31 pm
Location: Here

Post by Treefrog »

Sorry, I've been a bit sick this week, so I haven't had time to post. I changed a bit of the If:Then statements, giving a lot less memory errors. I'll code a bit more of the program, and see if I can keep them down.

Thanks for the help!
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

We are still here when you need us :P, hope you get better.
User avatar
KermMartian
Calc Wizard
Posts: 549
Joined: Tue 05 Jul, 2005 11:28 pm
Contact:

Post by KermMartian »

If you need to post source code, try http://sc.cemetech.net . You can also find tips on this kind of problem here:
http://www.cemetech.net/forum/viewtopic.php?t=906
Image Image Image
User avatar
thegamefreak0134
Extreme Poster
Posts: 455
Joined: Mon 23 Jan, 2006 10:09 pm
Location: In front of a Computer, coding
Contact:

Post by thegamefreak0134 »

You've got enough End statements to go with your If:Then/While/Repeat/For/ect. statements? This is often a cause of such errors. Of course, this usually also causes the program to not work properly... However, if you have say a long list of instructions and then a Goto to take it back to the top this can happen right under your nose. Does the program appear to "slow down" before the error?
I'm not mad, just a little crazy.

DarkNova - a little side project I run.
Post Reply