SKIP FOR cCurrentYear >= '1999'I need this to be in place all the time. If cCurrentYear = '2004', the item is disabled and if the cCurrentYear = '1998' the item is enabled.
* INIT or LOAD * redefine the menu DEFINE BAR n OF myMenu PROMPT "\<myPrompt" * Then set skip SET SKIP OF BAR n OF myMenu .T.then in the DESTROY or UNLOAD
* reset skip SET SKIP OF BAR n OF myMenu .F. * redefine the menu DEFINE BAR n OF myMenu PROMPT "\<myPrompt" ; SKIP FOR cCurrentYear >= '1999'This would mean that my form must be cognizant of the exact nature of the menu settings; not very object oriented. I would need to maintain the code in two places; once in the menu, and then again in the form.
* in the menu change to... SKIP FOR cCurrentYear >= '1999' AND FormCheck('myFormName') * global function defined in the mainline outside the application object. PROCEDURE FormCheck LPARAMETERS tcName LOCAL loForm, llFound llFound = .F. FOR EACH loForm IN _SCREEN.Forms IF loForm.Name == tcName llFound = .T. EXIT ENDIF ENDFOR RETURN llFoundThis will not handle multiple calls to the same form with different parameters. Using the Caption won't work because the Caption might change in the INIT or LOAD of the form depending on the cCurrentYear. Too many holes!
... SKIP FOR Something()>or with
SET SKIP OF BAR 1 OF file .T.>
>>DEFINE POPUP file MARGIN RELATIVE SHADOW COLOR SCHEME 4 >>DEFINE BAR 1 OF file PROMPT "\<Test" ; >> SKIP FOR Something() >>>>
>>SET SKIP OF BAR 1 OF file .T. >>>>