Variables accessed across forms

Login to reply to this topic.
Wed, 2005-09-21 23:29
Joined: 2005-09-21
Forum posts: 6
I have problems with using variables in a midlet.

I have a variable which I want each screen to have access to. This variable wonÂ’t be changed once obtained but it first must be extracted from a text field. So the user enters details in the textfield. In that screen the variable stores the value by textField.getString();

But if I access that variable in any other screens, the variable is empty. Any ideas?
Thank you
Kind Regards

Thu, 2005-09-22 11:25
Joined: 2005-08-10
Forum posts: 14
Re: Variables accessed across forms
Hi lifeline,

why dont u make ur variable static  and use it all across ur project.
If it doesnt work, tell me.

Cheers,
Amulya

ARB

Thu, 2005-09-22 21:51
Joined: 2005-09-21
Forum posts: 6
Re: Variables accessed across forms

Hi

Thank you for your help but
I still just get an empty string when the varible is accessed from the other classes.
Fri, 2005-09-23 05:53
Joined: 2005-08-10
Forum posts: 14
Re: Variables accessed across forms
Hi lifeline,

Its strange it is still not working.
Anyways, could u send me the code fragment where u have declared ur variable
and where u are accessing  it.
I think this problem is solvable.

Cheers,
Amulya

ARB

Sat, 2005-09-24 17:49
Joined: 2005-09-21
Forum posts: 6
Re: Variables accessed across forms
Thank you for your help arbhatia.
I decided to use Record Store to store the information it sloves the problem anyways.
Thanks again,
All The Best
  • Login to reply to this topic.