>I found a interesting bug in VFP, which can be solved by the apparently redundant sentence THIS.VALUE=THIS.VALUE. To show the bug:
>
>CREATE a table with a numeric field and a text field.
>
>APPEND a record to it
>
>Create a blank form, and include the table in its environment.
>
>Add a spinner to the form; set its ControlSource to the numeric field, and in its INTERACTIVECHANGE code write THISFORM.REFRESH().
>
>Add a textbox to the form; set its ControlSource to the text field, and in its REFRESH code write THIS.VALUE = STR(THISFORM.SPINNER.VALUE).
>
>Run it, and try to change the spinner by clicking on its arrow buttons!! What I get is: the spinner changes for an instant, and goes back to its original value. (This doesn´t happen if the objects have no ControlSource.)
>
>The solution? Add THIS.VALUE=THIS.VALUE at the beginning of the SPINNER.INTERACTIVECHANGE code.
>
>Weird!!
That's not the only place this is weird. Yesterday I was working with a from with a check box in a container. I had a method call in the interactive change event that did some yadda' yadda' and the a screen refesh. Every time I would click the check box, with initial value of 0, it would run the method then set itself back to uncheck. I solved it with:
tval = THIS.value
THISFORM.mthyaddayadda
THIS.value = m.tval
I just tried your approach
THIS.value = THIS.value
THISFORM.mthyaddayadda
And it works...my app is now 1 line smaller in two places...thanks.
Weeeeeeeiiiiiiiirrrrrrrrrddddddddddddd.