*--Base_app.DoMenu() *------------------------------------------------------------------------------- * * METHOD: .DoMenu() * : * OVERVIEW: Displays the menu identified in lcMenu. * : * SYNTAX: obj.DoMenu("Menu.mpr") where the argument is the * name of a menu file. * * USES: .aMenus[1] -- Array property of this object. * .cBaseMenu -- Character property of this object which contains * the name of the base menu (i.e. the menu that * is displayed when no forms are open). * * NOTE: If menu extention is not supplied, routine uses the default * extension. * *------------------------------------------------------------------------------- LPARAMETER lcMenu IF TYPE("lcMenu") # "C" MESSAGEBOX(; "Menu name passed to oApp.DoMenu "+; "is not a string. Unable to display the menu.",; 0,; "Invalid Menu Name") RETURN ENDIF LOCAL lnANewLen WITH this IF !("." $ lcMenu) *-- No extension. Provide the default extension lcMenu = ALLTRIM(lcMenu)+".mpr" ENDIF *-- Add the menu to the menu array IF TYPE("this.aMenus") # "C" .OR. lcMenu = .cBaseMenu .aMenus[1] = lcMenu ELSE lnANewLen = ALEN(.aMenus) + 1 DIMENSION .aMenus[lnANewLen] .aMenus[lnANewLen] = lcMenu ENDIF ENDWITH DO (lcMenu) RETURNI am certain there are many better ways of doing this, but for what its worth, this is how I do it.