>Hello All,
>
>*/I recently added the code below to an existing menu definition in a class method.
>
>DEFINE BAR 8 OF SHORTCUT PROMPT MyPrompt;
> KEY SHIFT+F3,"Shift+F3"
>
>*/This Crashes.
>ON SELECTION BAR 8 OF SHORTCUT this.ChangeCase()
The problem lies in the fact that this is referential to an object internal context, and the menu itself doesn't have such a reference in and of itself; there's no form or object association to guarentee the resolution of "this". If instead of "this", you referenced a routine in a .PRG as you noted, or used a globally resolvable object reference, you'd be OK. If a global object oApp existed with a method ChangeCase(), you could say:
ON SELECTION BAR 8 OF SHORTCUT oApp.ChangeCase()
If necessary, within the oApp.ChangeCase method, you could resolve the current form and control and redirect to a ChangeCase() method of the active object if one existed that way.
>
>This.ChangeCase is a method in this class., the error message I receive is This cannot be used outside a method, any ideas
>
>TIA
>Pete Kane.
>
>p.s. If I put the code from changecase in a prg and call it, no problem.