Catch incorrect user-function call

Hello,

If a function is called with a missing parameter, is there a way to catch that error and execute some user-defined response?
What I'd like is to simply print the calling sequence for that function.

For the simple example code below, if a command line call of:
 CatchErrors()
is issued, I'd like to print the comments below the initial function definition.

I've looked at the AbortOnRTE and try-catch-endtry functions but haven't had much success. Apologies if I'm just missing a simple built-in error handling function...

Thanks for your help,
Dave

FUNCTION CatchErrors(Param1)
//Here's some helpful information about this function:
//  CALLING SEQUENCE:  CatchErrors(Param1)
//    where:
//    Param1     Parameter to be printed later on
//

  Variable Param1
 
  Print Param1
 
END
In a function, unless the parameter is an optional parameter, which it is not in your example, the parameter can never be missing.

You can call the Debugger operation to break into the debugger, if it is enabled. The debugger will show you the call stack.

To learn about the debugger, execute:
DisplayHelpTopic "The Debugger"

It is usually best to turn on "Enable Debugger", "Debug on Error", "Wave, NVAR, SVAR Checking" while developing code.