Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SKIP FOR expression
Message
From
18/01/2005 08:09:10
 
 
To
17/01/2005 20:59:24
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Environment versions
Visual FoxPro:
VFP 7 SP1
Miscellaneous
Thread ID:
00977929
Message ID:
00978040
Views:
23
>Hi Peter.
>
>You could try something like
>SKIP FOR !Type("_Screen.ActiveForm.SomeProp") == "L" and _Screen.ActiveForm.SomeProp
>
>That should disable the item if there is no active form, the active form does not have a logical property by the name specified, or the property is set to True.
>
>Ian Simcock.

Hi Ian,

Your idea (and Gregory's, which is essentially the same) indeed appears to prevent the error condition. The funny thing is that there may be a case of a False Positive and that this doesn't matter anyway. This is the situation that there may be another window active that also has the same property and thus causes an actual test of that property, which may lead to an incorrect enabling/disabling of the menu-item. But it won't matter, because the form is inactive and no menu-item on the form can be selected. When activating the form, the skip-for expressions are re-evaluated and then it will be correct evaluations.

I guess it could be simplified with a generic function:
SKIP FOR SkipFor( '_vfp.activeform.SomeProp', .T. )

FUNCTION SkipFor( tcProp, tuTrueCondition )
   RETURN iif( type( tcProp ) = 'U', .T., eval( tcProp ) = tuTrueCondition )
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Previous
Reply
Map
View

Click here to load this message in the networking platform