wasCSharpSQLite – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | /* |
2 | * TellCmd.java -- |
||
3 | * |
||
4 | * Copyright (c) 1997 Sun Microsystems, Inc. |
||
5 | * |
||
6 | * See the file "license.terms" for information on usage and |
||
7 | * redistribution of this file, and for a DISCLAIMER OF ALL |
||
8 | * WARRANTIES. |
||
9 | * |
||
10 | * Included in SQLite3 port to C# for use in testharness only; 2008 Noah B Hart |
||
11 | * |
||
12 | * RCS @(#) $Id: TellCmd.java,v 1.1.1.1 1998/10/14 21:09:20 cvsadmin Exp $ |
||
13 | * |
||
14 | */ |
||
15 | using System; |
||
16 | using System.IO; |
||
17 | namespace tcl.lang |
||
18 | { |
||
19 | |||
20 | /// <summary> This class implements the built-in "tell" command in Tcl.</summary> |
||
21 | |||
22 | class TellCmd : Command |
||
23 | { |
||
24 | |||
25 | /// <summary> This procedure is invoked to process the "tell" Tcl command. |
||
26 | /// See the user documentation for details on what it does. |
||
27 | /// |
||
28 | /// </summary> |
||
29 | /// <param name="interp">the current interpreter. |
||
30 | /// </param> |
||
31 | /// <param name="argv">command arguments. |
||
32 | /// </param> |
||
33 | |||
34 | public TCL.CompletionCode cmdProc( Interp interp, TclObject[] argv ) |
||
35 | { |
||
36 | |||
37 | Channel chan; /* The channel being operated on this method */ |
||
38 | |||
39 | if ( argv.Length != 2 ) |
||
40 | { |
||
41 | throw new TclNumArgsException( interp, 1, argv, "channelId" ); |
||
42 | } |
||
43 | |||
44 | |||
45 | chan = TclIO.getChannel( interp, argv[1].ToString() ); |
||
46 | if ( chan == null ) |
||
47 | { |
||
48 | |||
49 | throw new TclException( interp, "can not find channel named \"" + argv[1].ToString() + "\"" ); |
||
50 | } |
||
51 | |||
52 | try |
||
53 | { |
||
54 | interp.setResult( TclInteger.newInstance( (int)chan.tell() ) ); |
||
55 | } |
||
56 | catch ( IOException e ) |
||
57 | { |
||
58 | throw new TclException( interp, "Error in TellCmd" ); |
||
59 | } |
||
60 | return TCL.CompletionCode.RETURN; |
||
61 | } |
||
62 | } |
||
63 | } |