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

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

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

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112
[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 - Problem with Array and OS3.3

Problem with Array and OS3.3

A PocketC native palm library offering native forms and assorted utilities

Postby cable_guy_67 on Sun Nov 16, 2003 6:40 pm

Joe,
I seem to have a problem with some code when it is run on a palmV with OS3.3 Follows is the code that generates the problem:

Code: Select all
pointer prize_list, gameboard;
string data;

data="172197065146059100171199146065172100197199171059059100199171172146197065171199059197065172100146170108183145055105193194105194170055193108145183145194105183170193055108193183194055108105170145";

round=0;

// prize_list is 2*4*8 array of prizes to be won with the arch number stored in it.
i=0;
prize_list = Array("i,2,4,8");
for(z=0;z<2;z++){
    for(y=0;y<4;y++){
   for(x=0;x<8;x++){
       prize_list[z][y][x]=substr(data,i,3);
       i=i+3;
   }
    }
}


On POSE and an actual device the following is generated
Virtual Machine Error
Addr: 43267
Func: my_function
Global ref out of range

This exact compile works fine on the other 3.5+ Roms and devices I have tested on. It appears that after the 24th call to substr() , (when z goes from 0 to 1) things get hinky. Am I missing something simple? This is the first time I call Array() or substr() in my code.

Thanks for any help.

Mark
cable_guy_67
 
Posts: 92
Joined: Mon Mar 31, 2003 2:28 am
Location: USA

Postby jstadolnik on Sun Nov 16, 2003 9:06 pm

Your code sample works flawlessly on the emulator using an OS3.3 rom. Your program is likely running out of dynamic heap (scratchpad) memory.

OS3.5+ devices generally have around 192k of heap space, where as pre-OS3.5 devices only have around 36k. If you have a lot of buffers and large arrays around your app is probably using too much heap for OS3.3 (and earlier OS varients). See the HeapSize() PToolbox function and the "Screen Buffers Section" for more details on the dynamic heap.

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 cable_guy_67 on Mon Nov 17, 2003 12:16 am

Thanks Joe, I believe you are correct. I went back and found another programe that I had and it worked fine. Thanks for the info on HeapSize(). I will see how far I am overdrawing the bank and what I can do about it. Back to the drawing board.

Mark
cable_guy_67
 
Posts: 92
Joined: Mon Mar 31, 2003 2:28 am
Location: USA


Return to Pocket Toolbox

Who is online

Users browsing this forum: No registered users and 1 guest

cron