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 - Garbage displaying in an alertc();

Garbage displaying in an alertc();

Discuss OrbForms Designer and PocketC Architect

Postby deadserious on Tue Jun 22, 2004 8:07 pm

Here are 2 nearly identical handlers. The first causes garbage to display in the alert. The second displays correctly. LocationData and LocationNamesFull are both stringlists. The problem occurs on real palm devices and on the emulator and simulator.

handler lstRooms.onselect() {
UIList lst;
lst = this;
alertc("Details",LocationData.item(LocationNamesFull.find(lst.gettext(lst.selitem))),"Done",alertInfo);
}

handler lstRooms.onselect() {
UIList lst;
string s = "";
lst = this;
s = LocationData.item(LocationNamesFull.find(lst.gettext(lst.selitem)));
alertc("Details",s,"Done",alertInfo);
}
deadserious
 
Posts: 61
Joined: Sat Jun 05, 2004 7:26 am
Location: USA

Postby nmc on Wed Jun 23, 2004 6:39 am

Read the docs: "Do not create UIList objects manually."
Instead, use a pointer: UIList *lst = this;"
nmc
 
Posts: 197
Joined: Tue May 27, 2003 8:42 pm
Location: Germany

Postby deadserious on Wed Jun 23, 2004 10:09 am

Sorry, that was a result of playing around to try to fix the problem. The following still causes garbage.

handler lstRooms.onselect() {
UIList* lst;
string s = "";
lst = &this;
alertc("Details",LocationData.item(LocationNamesFull.find(lst->gettext(lst->selitem))),"Done",alertInfo);
}
deadserious
 
Posts: 61
Joined: Sat Jun 05, 2004 7:26 am
Location: USA

Postby nmc on Wed Jun 23, 2004 7:08 pm

Any changes after replacing "lst->" by "this."?
Try to split your statement into smaller ones to determine the reason for the garbage.
nmc
 
Posts: 197
Joined: Tue May 27, 2003 8:42 pm
Location: Germany

Postby deadserious on Wed Jun 23, 2004 8:16 pm

No change.

But did you see the difference between the one that worked and the one that didn't???

The only difference is that I'm assigning the value to a string first before passing it into alertc().

FWIW, there is no garbage when passing it into alert() instead.
deadserious
 
Posts: 61
Joined: Sat Jun 05, 2004 7:26 am
Location: USA

Postby Cyplesma on Sun Oct 30, 2005 12:36 am

I got the same problem with garbage in an alertc.

in fact I've got two alertc one doesn't give me any problems the other one actually changes the garbage it displays. and finally on the third time displayed it shows what it's supposed to.

I do use a variable in the alertc statement in the message section, but that variable is a string.

any ideas?

even if I don't use any variables in the second alertc all the options except last (alertQuestion) both are alertQuestions, i still get the garbage on the second alertQuestion.
Cyplesma
 
Posts: 17
Joined: Fri Jan 09, 2004 8:23 pm
Location: USA

Postby dewey on Sun Oct 30, 2005 7:58 pm

This is a bug in the alertc and promptc functions. They are improperly releasing the string before displaying it, which only sometimes causes a problem. The reason the second form works is that the string is being copied to a local variable, rather than just being put on the stack. Since it is a local (and strings are internally ref-counted/copy-on-write), the string will not be freed until the function exits. This is fixed in the current dev tree, which will be in v4.0 in a couple months.
dewey
Site Admin
 
Posts: 749
Joined: Sun Oct 21, 2007 5:12 am

Postby danypoup on Thu Mar 09, 2006 5:55 pm

Indeed, it seems that this problem is not solved by OrbForms Designer 4.01. I've got this problem with alertc function : the only workaround was to put the message string in a variable and pass it to alertc function.
Example :
This one doesn't work, it generates garbage characters :

<font face="Courier New">alertc("About", "My app.\nVersion " + myapp.version, "OK", alertInfo);</font id="Courier New">

whereas this works :

<font face="Courier New">string strMessage = "My app.\nVersion " + myapp.version;
alertc("A propos de", strMessage, "OK", alertInfo);</font id="Courier New">

Compiled with OrbForms Designer 4.01 and tested under Palm Simulator 5.4.

FYI.
danypoup
 
Posts: 1
Joined: Thu Mar 09, 2006 5:38 pm
Location: France

Postby dewey on Tue Mar 14, 2006 3:29 am

I'll take another look at this. It looks like there must have been two issues.
dewey
Site Admin
 
Posts: 749
Joined: Sun Oct 21, 2007 5:12 am

Postby Rudi on Wed Jun 21, 2006 5:38 am

Sometimes i get also garbage with 4.0.1 when

first:
i define a string with "add string" in the IDE:
Name=strtest
Text=foobar test

and know:

a normal alert(strtest) and the alertc() display garbage.

But, its not easy to testing it, because small apps never display garbage, but apps with 100 string, 30 forms and tons of functions sooner or later you get garbage.
My Workarround is: Never use the IDE strings and also no normal defined string, i use if possible always the direct string
alert("bla bla foobaar")

Greets,
Rudi
Rudi
 
Posts: 33
Joined: Thu Feb 12, 2004 2:42 pm
Location: Germany

Postby dewey on Fri Jun 23, 2006 2:30 am

I will get this fixed for 4.1.
dewey
Site Admin
 
Posts: 749
Joined: Sun Oct 21, 2007 5:12 am


Return to OrbForms Designer and PocketC Architect

Who is online

Users browsing this forum: No registered users and 2 guests

cron