| java.lang.Object tcl.lang.ScanCmd
ScanCmd | class ScanCmd implements Command(Code) | | This class implements the built-in "scan" command in Tcl.
|
Method Summary | |
public void | cmdProc(Interp interp, TclObject argv) This procedure is invoked to process the "scan" Tcl command.
See the user documentation for details on what it does.
Each iteration of the cmdProc compares the scanArr's current index to
the frmtArr's index. |
cmdProc | public void cmdProc(Interp interp, TclObject argv) throws TclException(Code) | | This procedure is invoked to process the "scan" Tcl command.
See the user documentation for details on what it does.
Each iteration of the cmdProc compares the scanArr's current index to
the frmtArr's index. If the chars are equal then the indicies are
incremented. If a '%' is found in the frmtArr, the formatSpecifier
is parced from the frmtArr, the corresponding value is extracted from
the scanArr, and that value is set in the Tcl Interp.
If the chars are not equal, or the conversion fails, the boolean
scanArrDone is set to true, indicating the scanArr is not to be
parced and no new values are to be set. However the frmtArr is still
parced because of the priority of error messages. In the C version
of Tcl, bad format specifiers throw errors before incorrect argument
input or other scan errors. Thus we need to parce the entire frmtArr
to verify correct formating. This is dumb and inefficient but it is
consistent w/ the current C-version of Tcl.
|
|
|