Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refresh events
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01018314
Message ID:
01018317
Views:
9
Set a variable with the name of your field or UDF and use macro-substitution or Evaluate() depending on your needs...

Local lcMyVar
lcMyVar = iif(llSwitch, "MyTable.MyField", "MyUDF()"
? &lcMyVar
? Evaluate(lcMyVar)

...not exactly sure what all you are trying to do, but ExecScript() method may also prove useful for you -- it's in the VFP help file.

Then there's the suggestion that Sergey gave you, but depending on the amount of code it might be a real maintenance nightmare to copy and paste all the code that is almost exactly the same save for where the value comes from (UDF or Table Field).


>Does anyone know if its possible to programmatically change the code that executes when a control's refresh event fires?
>
>I have a custom class line shape that contains code to set the height and position when it is refreshed. These parameters are based on values contained in the table. I'd like to programmatically change the field pointer
>from the table to instead be a UDF and then back at the click of a button.
>
>Any suggestions?
>
>- Don
Previous
Reply
Map
View

Click here to load this message in the networking platform