Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting changes in control values
Message
 
To
29/10/1997 16:54:08
Elyse Pomerantz
Dynamic Data Concepts, Inc.
Brooklyn, New York, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00057294
Message ID:
00057297
Views:
29
>I have several pages of controls that are NOT bound to a ControlSource. I
>only want to process each page if at least one of the values on that page
>has changed. Is there any way to determine whether a value of a control
>(TextBox or ComboBox) has changed?
>
>Thanks
>Elyse

Elyse,

I was about to post almost exactly what "Fast Eddie" posted, but, as usual, he beat me to it.

There was one point he made I'd take issue with. If I understood him correctly, he suggested a logical for each page to let you know whether or not a value on the page had changed. If that's the case, that's a lot unnecessary overhead. What you can do is create a numeric property on the frame or form, initially set to zero. Then create a method, passing the page number to it, as a numeric parameter to change the value. The code might look something like this:

LPARAMETER pnpagenum

This.PageFlags = BITOR(This.PageFlags, 2 ^ (pnpagenum - 1))

When you need to find out if a value on any page has been changed, loop through the PageFlags and test using BITTEST(), like this:

FOR lni = 0 TO 31
IF BITTEST(This.PageFlags, lni)
* Something was changed.
ENDIF
ENDFOR

Of course, if there are more than 32 pages, you'll have to create a second set of flags.

George
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform