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 - Stack Overflow

Stack Overflow

Discuss OrbForms Designer and PocketC Architect

Postby JustAl1947 on Mon Mar 03, 2003 2:14 am

Just started my first application. Wanted to investigate initialization of a structure ( which is not really discussed in the help files ).

The following causes a stack overflow after pressing the OK button on the alert three times. I recall seeing that alert is not to be used between Draw.begin() and Draw.end(), which I am not doing.

My code ( with the default app.onstart() ):
-- -------------------------------------------------------------------
// mainform.oc
// Created for mainForm

struct FirstObj {
int i;
float f;
string s;
};

handler mainForm.onopen() {
// TODO: handle onopen event

}

handler mainForm.ondraw() {
//TODO: handle event
FirstObj f = { 5, 7.33, "this is a test" };
Draw d;
string s;

//alert("About to draw " + f.i + "\n" + f.f + "\n" + f.s);
s = "About to draw " + f.i + "\n" + f.f + "\n" + f.s;
alert (s);

d.attachForm(this);

d.begin();
d.text(clrText, 20, 40, f.i);
d.text(clrText, 20, 60, format(f.f,2));
d.text(clrText, 20, 80, f.s);
d.end();
}
---------------------------------------------------------------------

The error from Pose is

OrbFormsRT (2.0.2) has overflowed the stack. The functions currently using the stack are: BmpGetBits(4), PrvGetBltInfo(76), BltCopyRectangle(86), WinCopyRectangle(108), WinSaveBits(50), FrmDrawForm(58), FrmCustomAlert(78), Alert__FPCc(22), lib_alert__PP2VMi(32), Call__2VMFlbb(840), CallHandler__FUIUI(46)...

If I compile as a standalone application, then I press the OK alert button three times, the Pose screen flashes (the alert dialog box is back again), press the OK button three more times, and get the following error from Pose:

Test.Obj(1.0) has overflowed the stack. The functions currently using the stack are: cjsmwait(60), sjrmrsv(20), MemSemaphoreReserve(24), MemHandleNew(18), TxtParamString(70), PrvConstructCustomAlert(100), FrmCustomAlert(60), <Unknown@0x000CCB70>(230).

The code works if I do not do the alert. Are there restrictions to using alert beyond the Draw.begin()-Draw.end() restraint?

Thanks,
Al
JustAl1947
 
Posts: 15
Joined: Mon Mar 03, 2003 1:49 am
Location: USA

Postby dewey on Mon Mar 03, 2003 2:40 am

Displaying an alert will cause the current form's ondraw handler to execute (if the system was not able to save the form image behind it, or if using a debug ROM). Therefore, calling alert in the ondraw handler will cause a recursive draw, leading to a stack overflow.
dewey
Site Admin
 
Posts: 749
Joined: Sun Oct 21, 2007 5:12 am

Postby JustAl1947 on Wed Mar 05, 2003 9:33 am

Thank you for your quick response. I am using a debug ROM.
JustAl1947
 
Posts: 15
Joined: Mon Mar 03, 2003 1:49 am
Location: USA


Return to OrbForms Designer and PocketC Architect

Who is online

Users browsing this forum: No registered users and 1 guest

cron