wasCSharpSQLite – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | /* |
2 | * ErrorCmd.java -- |
||
3 | * |
||
4 | * Implements the "error" command. |
||
5 | * |
||
6 | * Copyright (c) 1997 Cornell University. |
||
7 | * Copyright (c) 1997 Sun Microsystems, Inc. |
||
8 | * |
||
9 | * See the file "license.terms" for information on usage and |
||
10 | * redistribution of this file, and for a DISCLAIMER OF ALL |
||
11 | * WARRANTIES. |
||
12 | * |
||
13 | * Included in SQLite3 port to C# for use in testharness only; 2008 Noah B Hart |
||
14 | * |
||
15 | * RCS @(#) $Id: ErrorCmd.java,v 1.1.1.1 1998/10/14 21:09:19 cvsadmin Exp $ |
||
16 | * |
||
17 | */ |
||
18 | using System; |
||
19 | namespace tcl.lang |
||
20 | { |
||
21 | |||
22 | /* |
||
23 | * This class implements the built-in "error" command in Tcl. |
||
24 | */ |
||
25 | |||
26 | class ErrorCmd : Command |
||
27 | { |
||
28 | |||
29 | public TCL.CompletionCode cmdProc( Interp interp, TclObject[] argv ) |
||
30 | { |
||
31 | if ( argv.Length < 2 || argv.Length > 4 ) |
||
32 | { |
||
33 | throw new TclNumArgsException( interp, 1, argv, "message ?errorInfo? ?errorCode?" ); |
||
34 | } |
||
35 | |||
36 | if ( argv.Length >= 3 ) |
||
37 | { |
||
38 | |||
39 | string errorInfo = argv[2].ToString(); |
||
40 | |||
41 | if ( !errorInfo.Equals( "" ) ) |
||
42 | { |
||
43 | interp.addErrorInfo( errorInfo ); |
||
44 | interp.errAlreadyLogged = true; |
||
45 | } |
||
46 | } |
||
47 | |||
48 | if ( argv.Length == 4 ) |
||
49 | { |
||
50 | interp.setErrorCode( argv[3] ); |
||
51 | } |
||
52 | |||
53 | interp.setResult( argv[1] ); |
||
54 | throw new TclException( TCL.CompletionCode.ERROR ); |
||
55 | } |
||
56 | } // end ErrorCmd |
||
57 | } |