The syntax is different, plus the label must precede the line in which proc appears:
long if 0
"MyCommandProcessHandler"
enterproc fn MyCommandProcessHandler( nextHandler as EventHandlerCallRef, theEvent as EventRef, userData as pointer )
'~'1
dim as OSStatus result : result = _eventNotHandledErr
// ...
exitproc = result
end if
local fn InstallMyCommandProcessHandler
'~'1
dim as EventTypeSpec eventSpec
eventSpec.eventClass = _kEventClassCommand
eventSpec.eventKind = _kEventCommandProcess
#if def _FBtoC // FBtoC
call InstallEventHandler ( fn GetApplicationEventTarget(), proc "MyCommandProcessHandler", 1, @eventSpec, #0, #0 )
#else // FB
begin globals
dim as proc sMyCommandProcessHandlerUPP
end globals
long if ( sMyCommandProcessHandlerUPP == 0 )
sMyCommandProcessHandlerUPP = fn NewEventHandlerUPP( [proc "MyCommandProcessHandler" + _FBprocToProcPtrOffset] )
end if
call InstallEventHandler( fn GetApplicationEventTarget(), sMyCommandProcessHandlerUPP, 1, @eventSpec, #0, #0 )
#endif // def _FBtoC
end fn