Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SET SKIP OF BAR question
Message
From
21/11/2006 11:05:20
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01170464
Message ID:
01171454
Views:
6
Then how do you skip. The collection of forms exist as you have shown in _SCREEN.Forms, but you still can't SET SKIP OF for a menu item that already has a SKIP clause.

Now it sounds like the only approach might be to remove all of the SKIP clauses from the menu and create a routine that will execute when UNLOADing that will SET SKIP OF based on the conditions. I don't like having to add a routine like that to the MenuController which is trying to stay object oriented. Some of the conditions may need to refer to external values in order to determine .T. or .F. of the SET SKIP OF command. This may be the only approach though.


>If i get you right you want to handle your menu globally.
>You can create a global collection or an array. To which each form adds itself and removes itself accordingly.
>In Something()
>
>FOR EACH loForm IN _SCREEN.Forms
>	IF loForm.Name is found in the collection/array
>		llFound = .T.
>		EXIT
>	ENDIF
>ENDFOR
>
>
>Kamil
>
>
>>That may work for a single menu item, but what if I want Something() to work for ALL menu items. Your suggestion would require Something() and SomethingElse() and MySomething()... One for each menu item because each would have different requirements.
>>
>>I have created a MenuController object which turns items on and off and places the text of the Window Caption into a 'Window' menu. All that the MenuController requires is the menu name, it doesn't even need to know the Prompt() (because Prompt() handles that.) But the only thing that is stopping the obejct from doing exactly what it is suppose to do, is the stupid SET SKIP OF on a menu item that already has a SKIP clause set doesn't work.
>>
>>I think Microsoft needs to create a menu function which will return the SKIP clause set on a menu item so that you can work around this exact problem.
>>
>>>I would put all controll into the hands of Something()
>>>
>>>function Something
>>>if cCurrentYear >= '1999'
>>>  return .t.
>>>endif
>>>
>>>llFound = .F.
>>>
>>>FOR EACH loForm IN _SCREEN.Forms
>>>	IF loForm.Name == 'MyFormName'
>>>		llFound = .T.
>>>		EXIT
>>>	ENDIF
>>>ENDFOR
>>>...
>>>return llFound
>>>
>>>
>>>Hope it helps
>>>Kamil
Gordon de Rouyan
DC&G Consulting
Edmonton, Alberta
Email: derouyag@shaw.ca
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform