wasCSharpSQLite – Blame information for rev 4

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 #undef DEBUG
2 /*
3 * SetCmd.java --
4 *
5 * Implements the built-in "set" Tcl command.
6 *
7 * Copyright (c) 1997 Cornell University.
8 * Copyright (c) 1997 Sun Microsystems, Inc.
9 *
10 * See the file "license.terms" for information on usage and
11 * redistribution of this file, and for a DISCLAIMER OF ALL
12 * WARRANTIES.
13 *
14 * Included in SQLite3 port to C# for use in testharness only; 2008 Noah B Hart
15 *
16 * RCS @(#) $Id: SetCmd.java,v 1.2 1999/05/09 01:23:19 dejong Exp $
17 *
18 */
19 using System;
20 namespace tcl.lang
21 {
22  
23 /*
24 * This class implements the built-in "set" command in Tcl.
25 */
26  
27 class SetCmd : Command
28 {
29 public TCL.CompletionCode cmdProc( Interp interp, TclObject[] argv )
30 {
31 bool debug;
32  
33 if ( argv.Length == 2 )
34 {
35 System.Diagnostics.Debug.WriteLine( "getting value of \"" + argv[1].ToString() + "\"" );
36  
37 interp.setResult( interp.getVar( argv[1], 0 ) );
38 }
39 else if ( argv.Length == 3 )
40 {
41 System.Diagnostics.Debug.WriteLine( "setting value of \"" + argv[1].ToString() + "\" to \"" + argv[2].ToString() + "\"" );
42 interp.setResult( interp.setVar( argv[1], argv[2], 0 ) );
43 }
44 else
45 {
46 throw new TclNumArgsException( interp, 1, argv, "varName ?newValue?" );
47 }
48 return TCL.CompletionCode.RETURN;
49 }
50 } // end SetCmd
51 }