tcl.lang
Class TclNumArgsException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by tcl.lang.TclException
              extended by tcl.lang.TclNumArgsException
All Implemented Interfaces:
Serializable

public class TclNumArgsException
extends TclException

This exception is used to report wrong number of arguments in Tcl scripts.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class tcl.lang.TclException
errIndex
 
Constructor Summary
TclNumArgsException(Interp interp, int argc, TclObject[] argv, String message)
          Creates a TclException with the appropiate Tcl error message for having the wring number of arguments to a Tcl command.
 
Method Summary
 
Methods inherited from class tcl.lang.TclException
getCompletionCode, setCompletionCode
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TclNumArgsException

public TclNumArgsException(Interp interp,
                           int argc,
                           TclObject[] argv,
                           String message)
                    throws TclException
Creates a TclException with the appropiate Tcl error message for having the wring number of arguments to a Tcl command.

Example:

 
 if (argv.length != 3) {
        throw new TclNumArgsException(interp, 1, argv, "option name");
 }
 

Parameters:
interp - current Interpreter.
argc - the number of arguments to copy from the offending command to put into the error message.
argv - the arguments of the offending command.
message - extra message to appear in the error message that explains the proper usage of the command.
Throws:
TclException - is always thrown.


Copyright © 2015. All rights reserved.