Re: Tcl "source" command

From: Bryan Oakley (bryan_at_bitmover.com)
Date: 11/25/03


Date: Tue, 25 Nov 2003 19:01:56 GMT

Bruce Graham wrote:

> ...When I do build a
> list out of all of these lines and try to execute it with either eval or
> after, I consistently get a message saying that "incr
> txaray(10001,ntext)" is not a valid command. Well, it looks like one to
> me, so I know I must be building the list incorrectly, but the problem
> is not apparent.

Pay very close attention to error messages; they are usually very
precise and people often view them with blinders on.

If you see an error message that says this:

    invalid command name "incr txaray(10001,ntxt)"

... notice where the quotes are. In the above example what tcl is
telling you is you tried to execute a command named "incr
txaray(10001,ntxt)" rather than the command "incr" with an argument of
"txaray(10001,ntxt)". Can you see the distinction?

You can generate this error message easily yourself interactively.
Perhaps doing so will give you clues as to what you are doing wrong.

     % "incr txaray(10001,ntxt)"
     invalid command name "incr txaray(10001,ntxt)"

You'll be pleased to know, though, that if you create a literal string
in FORTRAN that is proper Tcl, you can eval it and expect it to Do The
Right Thing. The problem you are having appears to be related to how
you are taking the FORTRAN output and inserting it in some context. The
general concept is correct -- create a literal string and eval it, but
it seems you're doing something with the data before evaling it which is
causing the problems.



Relevant Pages

  • Re: Newbie question about command line execution
    ... > I can't figure out how execute a program on the command line. ... > Here is the error message after typing the name and hitting ...
    (comp.os.linux.misc)
  • Re: Newbie question about command line execution
    ... > I can't figure out how execute a program on the command line. ... > the error message after typing the name and hitting Enter: ...
    (comp.os.linux.misc)
  • Re: dbms_errlog
    ... I'm trying to execute the ... dbms_errlog.create_error_log command through SQL Plus but I keep ... getting the error message: ...
    (comp.databases.oracle.server)
  • Re: startup problems
    ... Enquire, plan and execute. ... command .com corrupted ... can not bootup winodows98 ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Counter
    ... time i have run this command. ... execute .what is the error in it. ... proc generateID { ...
    (comp.lang.tcl)