Problem:
For some unknown reason, my variable is resetting even though I did not tell
it to.

Background:
What I am doing is sending information from one form to another.  Form1 is a
search form where you enter a text string and select a type of search (which
field to search by).  Form2 is a results form where you can iterate through
the results of the search.

Method Used:
What I did was I created two variables (declared in form1's header), a
CharPtr and a UInt.  I did a MemHandleLock on the search text field and set
that to the CharPtr and I set the UInt to be either 0, 1, or 2 (#defines for
each field type).  Then I opened Form2 using FrmGotoForm.  (I do release the
MemHandleLock, but only after I am done using it ... at the end of form2).
The only other place where the UInt is changed is in the Form1Init Function
(which is called on the form1 frmOpen event... it is changed to zero).

Testing:
During my test: the UInt is = 2 in form1, however when I get to where I use
it in Form2, it is 0.  I'm not sure of the value of the CharPtr (i can't
figure out how to set a watch), however when it comes to doing an "StrStr"
on the CharPtr it crashes my program so I must assume it isn't the correct
value either. (one wierd thing is that it doesn't crash on the first use of
StrStr, but on the second.)

Can anyone please help me figure out what I am doing wrong here?  Thank you
very much in advance for any help you can give.

Sandra Webb



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to