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 - Prefs saving problem - new user

Prefs saving problem - new user

Discuss OrbForms Designer and PocketC Architect

Postby FrankG on Sun Jan 26, 2003 10:32 am

The following code to save preferences looks okay to me but isn't working. All that gets saved in the unsaved prefs file under the creator ID is an entry of 6 bytes of zeros. The four alerts alerts execute indicating a "true" return from the prefs.set and the values indicate a successful assignment. Interrogating the prefs file afterward show the 6 hex zeros and the prefs.get in openform fails.

Any clues are appreciated,
Frank

//****** at top of program
struct Prefrec {
string s;
int n;
};

///******

handler mainForm.onclose() {
//TODO: handle event
Prefrec pr[2];
Preferences prefs;

pr[0].s = TxtN1.text;
pr[1].s = TxtN2.text;
pr[0].n = B1; // int variable
pr[1].n = B2; // int variable
if (prefs.set(app.creator, false, pr, typeof(Prefrec), 2)) {
alert("sn1='"+pr[0].s+"'");
alert("sn2='"+pr[1].s+"'");
alert("b1='"+pr[0].n+"'");
alert("b2='"+pr[1].n+"'");
}
}
FrankG
 
Posts: 210
Joined: Thu Jan 23, 2003 7:58 pm

Postby sgibson on Sun Jan 26, 2003 1:09 pm

Instead of:

if (prefs.set(app.creator, false, pr, typeof(Prefrec), 2))

try:

if (prefs.set(app.creator, false, &pr, typeof(Prefrec), 2))

The only difference being using the "address of" operator on pr since that particular argument wants a pointer.

That's all I could see right off the bat...

-Steve


perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'
-Steve
sgibson
 
Posts: 24
Joined: Mon Oct 14, 2002 3:18 pm
Location: USA

Postby FrankG on Sun Jan 26, 2003 4:50 pm

Steve,

You're right about that argument needing to be an address but as "pr" is an array, the array name alone serves as the array address (i.e. pr == &pr[0]) a pointer. Plus I couldn't get &pr to compile.

You're idea prodded me to try &pr[0]. It compiled but I still get the 6 bytes of zeros saved in the preferences rather than the actual data.... :?:

Thank you for the suggestion!
Frank
FrankG
 
Posts: 210
Joined: Thu Jan 23, 2003 7:58 pm

Postby brianbb on Wed Jan 29, 2003 6:07 pm

Instead of "typeof(Prefrec)" try <b>typeof(pr)</b>

A filled struct variable with strings may have a different typeof than a struct itself.
brianbb
 
Posts: 2
Joined: Mon Jan 20, 2003 5:51 pm

Postby FrankG on Thu Jan 30, 2003 8:08 pm

Well.... I changed the code to save to saved preferences and it works as shown except for the false change to true. Curious!

Enjoying OrbWorks :) Really! :):)
Frank
FrankG
 
Posts: 210
Joined: Thu Jan 23, 2003 7:58 pm


Return to OrbForms Designer and PocketC Architect

Who is online

Users browsing this forum: No registered users and 6 guests

cron