wasCSharpSQLite – Blame information for rev

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 /*
2 * AppendCmd.java --
3 *
4 * Implements the built-in "append" Tcl 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: AppendCmd.java,v 1.2 1999/07/28 01:59:49 mo Exp $
16 *
17 */
18 using System;
19 namespace tcl.lang
20 {
21  
22 /*
23 * This class implements the built-in "append" command in Tcl.
24 */
25  
26 class AppendCmd : Command
27 {
28 public TCL.CompletionCode cmdProc( Interp interp, TclObject[] objv )
29 {
30 TclObject varValue = null;
31  
32 if ( objv.Length < 2 )
33 {
34 throw new TclNumArgsException( interp, 1, objv, "varName ?value value ...?" );
35 }
36 else if ( objv.Length == 2 )
37 {
38 interp.resetResult();
39 interp.setResult( interp.getVar( objv[1], 0 ) );
40 }
41 else
42 {
43 for ( int i = 2; i < objv.Length; i++ )
44 {
45 varValue = interp.setVar( objv[1], objv[i], TCL.VarFlag.APPEND_VALUE );
46 }
47  
48 if ( varValue != null )
49 {
50 interp.resetResult();
51 interp.setResult( varValue );
52 }
53 else
54 {
55 interp.resetResult();
56 }
57 }
58 return TCL.CompletionCode.RETURN;
59 }
60 } // end AppendCmd
61 }