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 - Forms: LOAD and getting field data

Forms: LOAD and getting field data

A PocketC native palm library offering native forms and assorted utilities

Postby WauloK on Tue Mar 26, 2002 7:38 am

Howdy yet again. I'm back, y'all.

Q1. When using many forms from RsrcEdit, is it best to open the whole lot at the start of my C program? Is there any advantage to only opening them when they are displayed? Does the form delete function remove the from from memory or wipe it altogether.. ie. can i LOAD the form when needed, then DRAW it and then FREE it so I have memory, and LOAD it yet again when it is next required?

Honest! That was one question ;)

Q2. How do I get the value entered into a field? Eg. I have a screen saying "Please enter your guess below" and a field to type in and a button with OK and one with CANCEL.
If they hit OK, how do I get the value typed into the field before they hit OK?

Sure it's two questions only.. you have to think LATERALLY ;)

Funky groovy PocketC support site.
http://pocketc.bangrocks.com/
If you love PocketC, you'll love this!
Join and become part of the community!
News, reviews, free source code and more!
Funky groovy PocketC support site.
http://pocketc.bangrocks.com/
Iron Filings v2.0 released.
Download a demo version at http://www.palmgear.com
Made with PocketC!
WauloK
 
Posts: 232
Joined: Tue Jan 15, 2002 2:41 am
Location: Australia

Postby tthkbw on Tue Mar 26, 2002 12:52 pm

FgetText(ID) will return the string from the field. FsetText(ID,"string") will set the text to "string".

Don't know about memory usage, but I LOAD and FREE as needed. Even complex forms load quickly in the new PtoolboxLib with resource forms.


tthkbw
tthkbw
 
Posts: 75
Joined: Wed Nov 07, 2001 4:04 pm
Location: USA

Postby WauloK on Tue Mar 26, 2002 8:39 pm

Aha! I see it now, thanks. I thought it would be something else.

Funky groovy PocketC support site.
http://pocketc.bangrocks.com/
If you love PocketC, you'll love this!
Join and become part of the community!
News, reviews, free source code and more!
Funky groovy PocketC support site.
http://pocketc.bangrocks.com/
Iron Filings v2.0 released.
Download a demo version at http://www.palmgear.com
Made with PocketC!
WauloK
 
Posts: 232
Joined: Tue Jan 15, 2002 2:41 am
Location: Australia

Postby jstadolnik on Wed Mar 27, 2002 2:52 am

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Q1. When using many forms from RsrcEdit, is it best to open the whole lot at the start of my C program?
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

It depends. The advantages of loading a form up front and not freeing it are: 1) you don't pay any more load time cost (though they are likely small), 2) the state of the form (buttons, fields, lists, etc) isn't reset if you redraw the form - the previous values remain, and 3) by not freeing the form you can access the state of the buttons, fields, and lists at a later time. See code below.

For example:
//To retrieve the field value from a form other than the current one, say form 4000...
Fctl(SETFORM,4000);
text=FgetText(4001); //get field data
Fctl(SETFORM,previousFormId); //critical!

The two disadvantage of not freeing a form is: 1) is takes up some dynamic heap space, usually not much though, and 2) the previous state of the form remains when you redraw the form (sometimes this is not desirable).

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Does the form delete function remove the from from memory or wipe it altogether.. ie. can i LOAD the form when needed, then DRAW it and then FREE it so I have memory, and LOAD it yet again when it is next required?
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

When you do a FREE on a form it is completely removed from memory along with the state of any objects in it (fields, buttons, lists, etc).

You can LOAD and FREE a form as needed if you like, or you can keep it around, whatever suites your needs.

Joe

PTB secret: Fctl(15,x); //pushes button x



The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm

Edited by - jstadolnik on 03/26/2002 20:55:08
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby WauloK on Wed Mar 27, 2002 7:52 am

Thanks, Joe!
I might FREE forms when I have finished with them. I only need the data immediately after they enter it and hit OK. After that, I will free the memory again.

Funky groovy PocketC support site.
http://pocketc.bangrocks.com/
If you love PocketC, you'll love this!
Join and become part of the community!
News, reviews, free source code and more!
Funky groovy PocketC support site.
http://pocketc.bangrocks.com/
Iron Filings v2.0 released.
Download a demo version at http://www.palmgear.com
Made with PocketC!
WauloK
 
Posts: 232
Joined: Tue Jan 15, 2002 2:41 am
Location: Australia


Return to Pocket Toolbox

Who is online

Users browsing this forum: No registered users and 2 guests

cron