Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check box value from screen

Status
Not open for further replies.

mwitwer

Programmer
May 14, 2002
13
US
I am using FoxPro 2.6. I have a screen that includes a check box on it. I am initializing the associated variable before I launch the screen, but if I select the check box and hit my OK button to exit the screen, the variable's value does not change. In the code it will stay whatever I init it to. The initial variable also does not affect it's initial state on the screen; if I init it to 1 or .T. it is not checked when the screen is launched. I have radio buttons and text fields on this screen as well and they all work fine. I am new to using FoxPro, so please give me a hint as to what is going on here.

Thanks,

Mark
 
Has the memory variable that is used for the check box been initialized outside of the screen itself or declared PUBLIC?

If not, then the variable and its contents are lost when the screen closes.

If it has been defined outside, then is it perhaps declared PRIVATE? If this is true, then the variable will return to the value it has prior to its use within the screen.
Check on these issues and let us know. If this doesn't help, maybe when we get more info. we can be of better assistance.

Good Luck,
jrbbldr
jrbbldr@yahoo.com
 
The check box is initialized before launching the screen and has not been declared PUBLIC or PRIVATE. All other screen control variables were declared and initialized the same way, and they work fine.

Thanks
 
Well, at least we have eliminated the easy answers.

Have you tried to display the check box variable in the Debug window while using the Trace window and to step through the screen.SPR file? It may be tedious, but sometimes its the best way to see what is going on.

Good Luck,
jrbbldr
jrbbldr@yahoo.com


 
Make sure that the variable does not have the same name as a field in an open table. Try using the "m." prefix to explicitly point out that you're refering to a memory variable instead of a table field. Also pay attention to the name you choose for memory variables. Simply choosing another name can sometimes eliminate conflicts. Finally, try initialising the variables in the setup snippet of the screen and declare them private. That way the variables will be privately declared to the resulting SPR and variables from calling programs with identical names will be overridden.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top