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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checkbox woes

Status
Not open for further replies.

mmerlinn

Programmer
May 20, 2005
748
US
[ ]
I have a screen that has two checkboxes on it that has been working perfectly for years.

Now I need to add another checkbox, but when I do I am getting a problem that is driving me nuts.

Basically, the NEW checkboxes, on first access, whether by mouse or tab, always call the same WHEN clause TWICE. On subsequent accesses the WHEN clause is only called ONCE. All of the OLD checkboxes work as expected only calling the WHEN clause once. I am at my wits end trying to fix this problem.

Here is a cut & pasted sample checkbox and when clause as generated by GENSCRN:

[blue]
@ 9.067,2.857 GET Sample ;
PICTURE "@*C3 Sample" ;
SIZE 1.417,9.833 ;
DEFAULT 0 ;
FONT "Geneva", 10 ;
STYLE "T" ;
WHEN _2bf115qcx()
[/blue]

[blue]

* *********************************************************
* *
* * _2BF115QCX Sample WHEN
* *
* * Function Origin:
* *
* * From Platform: Macintosh
* * From Screen: PARTINFO, Record Number: 132
* * Variable: Sample
* * Called By: WHEN Clause
* * Object Type: Check Box
* * Snippet Number: 2
* *
* *********************************************************
*
* This is sometimes called twice

FUNCTION _2bf115qcx && Sample WHEN
#REGION 1
test = 1
[/blue]

When I access the checkbox the code somehow calls this GET twice the first time, but only once on subsequent accesses.

Does anyone have any idea what is happening here? Or where I can look to find the problem?

mmerlinn


"Political correctness is the BADGE of a COWARD!"
 
Can I ask, why is there a "3" in "@*C3 Sample"?
Also, is it possible to just test for a value and not use a function for the 'when'?
The reason I ask is there is no return value for the function, so it may be undefined or unexpected.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
The WHEN clause allows or stops the selection of a check box, based on the logic of the WHEN clause. It will not cause iteration, which most likely is coming from a VALID clause.
 
[ ]

Return value for WHEN clauses is automatically .T. unless otherwise defined as .F.

Will try to remove the WHEN and see what happens. Also will find out why GENSCRN put a '3' in the picture clause.

No VALID clauses in this. Is reiterating through the new checkbox only on the first time through, never after that. And never for the original 2 checkboxes on this page.

I think I will c&p one of the originals as a new checkbox and see what happens.

Will try to get back faster, but I suddenly have a problem with over 300 webpages that I must solve first.

mmerlinn


"Political correctness is the BADGE of a COWARD!"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top