wasCSharpSQLite – Blame information for rev
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | /* |
2 | * UnsetCmd.java |
||
3 | * |
||
4 | * Copyright (c) 1997 Cornell University. |
||
5 | * Copyright (c) 1997 Sun Microsystems, Inc. |
||
6 | * |
||
7 | * See the file "license.terms" for information on usage and |
||
8 | * redistribution of this file, and for a DISCLAIMER OF ALL |
||
9 | * WARRANTIES. |
||
10 | * |
||
11 | * Included in SQLite3 port to C# for use in testharness only; 2008 Noah B Hart |
||
12 | * |
||
13 | * RCS @(#) $Id: UnsetCmd.java,v 1.2 1999/07/28 03:28:52 mo Exp $ |
||
14 | * |
||
15 | */ |
||
16 | using System; |
||
17 | namespace tcl.lang |
||
18 | { |
||
19 | |||
20 | /// <summary> This class implements the built-in "unset" command in Tcl.</summary> |
||
21 | |||
22 | class UnsetCmd : Command |
||
23 | { |
||
24 | /// <summary> Tcl_UnsetObjCmd -> UnsetCmd.cmdProc |
||
25 | /// |
||
26 | /// Unsets Tcl variable (s). See Tcl user documentation * for |
||
27 | /// details. |
||
28 | /// </summary> |
||
29 | /// <exception cref=""> TclException If tries to unset a variable that does |
||
30 | /// not exist. |
||
31 | /// </exception> |
||
32 | |||
33 | public TCL.CompletionCode cmdProc( Interp interp, TclObject[] objv ) |
||
34 | { |
||
35 | switch ( objv.Length ) |
||
36 | { |
||
37 | case 2: |
||
38 | interp.unsetVar( objv[1], 0 ); |
||
39 | break; |
||
40 | case 3: |
||
41 | for ( int i = ( objv[1].ToString() != "-nocomplain" ) ? 1 : 2; i < objv.Length; i++ ) |
||
42 | { |
||
43 | Var.unsetVar( interp, objv[i].ToString(), 0 ); |
||
44 | } |
||
45 | break; |
||
46 | default: |
||
47 | if ( objv.Length < 2 ) |
||
48 | { |
||
49 | throw new TclNumArgsException( interp, 1, objv, "varName ?varName ...?" ); |
||
50 | } |
||
51 | break; |
||
52 | } |
||
53 | |||
54 | return TCL.CompletionCode.RETURN; |
||
55 | } |
||
56 | } |
||
57 | } |