Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Binding to changes in a SETting?
Message
 
To
04/08/2006 17:01:05
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01143070
Message ID:
01143136
Views:
8
>>I created a menu for my department which called various utilities. It worked well.
>>
>>Then I got fancy, and decided to have the menu options call a procedure to call the utilities, rather than call the utilities themselves. That decision was... not so solid.
>>
>>Some of these utilities do a SET PROCEDURE TO in the middle, which promptly blows away the menu's reference to its own procedure.
>>
>>As a workaround, I have a "reset-SET-procedure" menu item, which doesn't go through the procedure. However, I'd like to figure out a way to have the menu see changes in SET("Procedure") and add itself back in.
>>
>>I was going to try something elaborate involving a textbox added to the screen with ControlSource='SET("Procedure")', its assign method, and BINDEVENTS, but that fell by the wayside when I discovered I couldn't make a function call a ControlSource.
>>
>>Has anybody actually pulled something like this off? :-)
>
>Garret,
>A little confusing:) I don't see how would setting controlsource to set('procedure') help but you can set controlsource to a function. Surround it with parentheses.
>
>Isn't checking "MYPROCEDURE"$set("procedure") easier? Or do ... in ...?

The menu runs at startup, and sits there while everything else runs. If one of the "everything else"s is ill-behaved and does a SET PROCEDURE TO as part of its cleanup, the menu loses its reference. I tried saving the SET("Procedure") before running the utility and re-setting it afterwards, but since it isn't a modal form, the form is still up when the menu restores the SETting, and gets to its own SET PROCEDURE later.

I could fix this by fixing all of the utilities the menu calls, but I'd also like to make the menu not rely on good behavior of its children. :-)

Hmm, maybe I'm overly-complicating things. I could add a timer to _SCREEN that checks SET PROCEDURE every minute or so... *goes away, starts typing, and forgets this window is open*
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Previous
Reply
Map
View

Click here to load this message in the networking platform