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 - saving and reusing variables
Page 1 of 1

PostPosted: Sun Nov 17, 2002 1:24 pm
by Eli
I am trying to enter values in a form or dialog box which will then be used as input to another form. I know i can get the value but then i can't seem to be able to use it in other forms. The user should get a blank line on first invocation, eventually data will be saved in a pdb which will be used to show the values when they go to the same forms again.
Below is a short example of my problem. I need to save the value of ED_PLAYER0 in the DB_PLAYER into jt (later this will be part of array ros) but when i return to FORM_SETUP i can't make it show as part of FIELD3. I
I have tried differnt things with no luck. I am stuck if i can't do this. I think my problem is with the fevent command but i am not sure what is wrong?????

thanks in advance.

//lite2.c

library "PToolboxLib"
#include "../Fctl.h"

@cid "et01";
@name "PalmTest";
@dbname "PalmTest";
@ver ".1";
@sicon1 "../small1.bmp";
@licon1 "../large1.bmp";

#define FORM_SETUP 6000
#define RB_SETUP 3200
#define BT_PLAYERS 3270
#define DG_NAMES 3271
#define ED_PLAYER0 3201
#define BT_RTN 6101
#define FIELD3 3033
main()
{
int e,i;
string jt;
pointer ros;
ros = Array("siiis,18,5");

//FORM SETUP
Form(FORM_SETUP,"SETUP");
{
Field(FIELD3,0x001,10,40,80,16,64,jt); // <-- THIS IS WHERE I NEED TO FILL IN THE VALUE
// FROM DG_NAMES "ED_PLAYER0"
Button(BT_PLAYERS,0x001,40,80,0,0,"Names");
}

Dialog(DG_NAMES,1,15,158,136,"Enter Players Names");
{
Field(ED_PLAYER0,0x0001,2,15,70,0,15,jt); // <--- THIS WILL COME FROM DB AFTER
// USER ENTERS VALUE FIRST TIME
Button(BT_RTN,0x000,55,120,0,0,"RETURN");
}

Fctl(DRAW,FORM_SETUP);

while(1)
{
e=Fevent(1);
if(e>240 && Fctl(EXIST,DG_NAMES) ) // <--- IS THIS CORRECT?
{
jt = FgetText(ED_PLAYER0); // <--- THIS IS WHERE I THINK I AM HAVING PROBLEMS.
}
switch(e)
{
case BT_PLAYERS:
Fctl(DRAW,DG_NAMES);
break;
case BT_RTN:
Fctl(DRAW,FORM_SETUP);
FsetState(BT_PLAYERS,0);
break;
}
}
}



Eli

PostPosted: Sun Nov 17, 2002 5:23 pm
by jstadolnik
Use the FsetText function.

Joe

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

PostPosted: Sun Nov 17, 2002 7:26 pm
by Eli
Joe, thanks for the prompt response.
I tried putting

FsetText(FIELD3,jt);
in 3 different places in the form, in the fevent loop and in the case and none worked. What am i doing wrong??? I am baffled.

Eli

PostPosted: Sun Nov 17, 2002 11:51 pm
by jstadolnik
Based upon the limited information you gave, I really don't have much of a clue to what you are doing wrong.

The only thing I can think is that you are tring do an FgetText/FsetText on an object which is not present in the current form. Those functions only work on ojects in the current active form.

You can use the SETFORM Fctl command to change the current form, but always change it back before you call Fevent again.

Joe


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

PostPosted: Mon Nov 18, 2002 2:21 am
by jstadolnik
Another approach is to simply extract your data from a form before you draw the next form. That way you don't have to muck with SETFORM to extract data from non-visible forms when you need it.

Joe

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

PostPosted: Mon Nov 18, 2002 6:57 pm
by Eli
Joe, i thought that's what i was trying to do with

if(e>240 && Fctl(EXIST,DG_NAMES) ) // <--- IS THIS CORRECT?
{
jt = FgetText(ED_PLAYER0); // <--- THIS IS WHERE I THINK I AM HAVING PROBLEMS.
}

when i hit the Return button it should save the value of ED_PLAYER0 into "jt". Then when i return to FORM_SETUP i just want to display that value in FIELD3, but it never shows it.

When do i enter the FsetText if i need to open the form first? When i tried putting the command before the
Field(FIELD3,0x001,10,40,80,16,64,jt);
it gives me a error in the POSE. ???????

Sorry to bother again, but this is my first program and i am still having problems understanding some of the palm setups.

Eli

PostPosted: Mon Nov 18, 2002 7:49 pm
by jstadolnik
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
if(e>240 && Fctl(EXIST,DG_NAMES) ) // <--- IS THIS CORRECT?
{
jt = FgetText(ED_PLAYER0); // <--- THIS IS WHERE I THINK I AM HAVING PROBLEMS.
}
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

If ED_PLAYER0 doesn't exist in the current form it's not going to work.

You should probably do: if(e==BT_RTN) { jt=FgetText... }
and ensure that BT_RTN lives in only one form.

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
When do i enter the FsetText if i need to open the form first? When i tried putting the command before the
Field(FIELD3,0x001,10,40,80,16,64,jt);
it gives me a error in the POSE. ???????
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

So you are trying to set the text in a field before you've created the field?

Joe

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

PostPosted: Tue Nov 19, 2002 12:01 am
by Eli
Thanks! T guess i need to understand fevents better. i am of to my next problem (arrays!).

Eli