Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - Out of Memory problems

Out of Memory problems

A PocketC native palm library offering native forms and assorted utilities

Postby Dman on Tue Jan 08, 2002 11:16 pm

Ok, I have some code that readsa variable from a database, proname, then a label that says Label(0,140,"Bot Name:"+proname);
now this worked fine, until I moved the db reading code from main to a seperate include file. The DB read works fine, but when the Form draws, I get an out of memory error. I took out the +proname, and the code worked fine. proname is a string and is declared as such. The inlude file is included. Any thoughts on what is wrong?

big brother is watching
----[self-mutilation or self-empowerment?]----
Dman
 
Posts: 128
Joined: Mon Jul 02, 2001 8:08 pm
Location: USA

Postby jstadolnik on Wed Jan 09, 2002 1:43 am

I have no clue. I did a small test but I can't seem to replicate the error. Can you please provide some source code showing the problem. Also, what OS version are you using?

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby Dman on Tue Jan 15, 2002 1:41 am

I am using OS version 3.5.2 PocketC 4.1.1 and PToolboxLib 7.0 (or is it .1?)
Here's the function that retrives a name from a database. It's the first thing run after graph_on(). I don't think the problem is here.
<pre id=code><font face=courier size=2 id=code>/$grabname
grabname() {
x=dbenum(1,"PCvm","rfpm");
if(x==0) {
x=confirm("Would you like to set-up a new bot?");
if(x==1) {
proname=gets("Please enter the name of your bot");
dbopen("robfmaster");
dbwrite(proname);
dbclose();
dbcreatex(proname,"rfpr","PCvm");
/*
unused skill points
damage points
shield points
fights total
fights won
Level 1 comp
Level 2 comp
etc.
*/
dbwrite(0);
dbwrite(0);
dbwrite(0);
dbwrite(0);
dbwrite(0);
for(x=1;x<=16;x++){
dbwrite("no");
}
dbclose();
} else {
alert("continuing without will cause problems!");
}
}
dbopen("robfmaster");
proname=dbread("s");
dbclose();
}//end of function
</font id=code></pre id=code>
Then here's where I initialise the Label (I am including the rest of the form for posterity, the label causing the problem is near the bottom, with +proname on the end of it)
<pre id=code><font face=courier size=2 id=code>
init_controls()
{
int pos,font_height;
//puts("integers declared\n");
pointer p;
puts("p declared\n");
font_height=FontHeight();
Button(playga,0,50,43,53,font_height,"Fight!");
puts("button fight\n");
Button(PlayerInfo,0,50,73,53,font_height,"Player Info");
puts("button pinfo\n");
Button(LoadLevel,0,51,88,53,font_height,"Load Level");
puts("button load level\n");
Button(Store,0,51,103,53,font_height,"Store");
puts("button store\n");
Button(Practice,0,50,58,53,font_height,"Practice");
puts("button practice\n");
Label(h6,39,21,"Robot Fiqhters v1.2b");
puts("label rf 1.2b\n");
Label(h7,28,122,"written by Dan Hargett");
puts("label written by\n");
Label(h8,22,131,"skaterx_26@hotmail.com");
puts("label email\n");
Label(h9,0,140,"Bot name:"+proname);
puts("label bot name\n");
}</font id=code></pre id=code>
Then it draws the form. I have 1.9 MB free, and I did add in a Heap function, once to chedck it and once just to defragment, and I had plenty of heap space, and the defrag didn't help. Maybe you can?

big brother is watching
----[self-mutilation or self-empowerment?]----
Dman
 
Posts: 128
Joined: Mon Jul 02, 2001 8:08 pm
Location: USA

Postby jstadolnik on Tue Jan 15, 2002 2:33 am

Do you call init_controls more than once?

If you do, you need to do a Fctl FREE on the form before you call init_control a second time. Otherwise will end up installing the same objects more than once per form, which results in highly unpredictable behavior.

A form object should only be installed once per form.

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby Dman on Tue Jan 15, 2002 9:18 pm

No, this happens on the first go around. I wish it was that easy, but I remember from another post and I do free the forms now, when they go into the other functions. I think I'll try it on the emulator and see what happens

big brother is watching
----[self-mutilation or self-empowerment?]----
Dman
 
Posts: 128
Joined: Mon Jul 02, 2001 8:08 pm
Location: USA

Postby jstadolnik on Tue Jan 15, 2002 11:20 pm

Try the OS3.5.3 patch. http://www.palm.com/support/downloads/update353.html

Failing that, what does the emulator do running a 3.5 debugger rom?

Joe


The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA


Return to Pocket Toolbox

Who is online

Users browsing this forum: No registered users and 2 guests

cron