Re: TCL equivalent of PHP "phpinfo()"?

From: Phil Powell (soazine_at_erols.com)
Date: 01/03/04


Date: Fri, 2 Jan 2004 19:20:38 -0500


"Marc Spitzer" <mspitze1@optonline.net> wrote in message
news:8665ftkhr3.fsf@bogomips.optonline.net...
> "Phil Powell" <soazine@erols.com> writes:
>
> > See below..
> >
> > "Michael A. Cleverly" <michael@cleverly.com> wrote in message
> > news:Pine.LNX.4.44.0401021546520.20207-100000@gibraltar.cleverly.com...
> > > On 2 Jan 2004, Phil Powell wrote:
> > >
> > > > Michael: Ich hab keine ahnung...
> > > >
> > > > I have no idea why it works, period. I don't understand the concept
> > > > of using global and upvar together and it magically works for me so
I
> > > > am not comfortable with using this code until, line by line, I fully
> > > > understand it.
> > > >
> > > > Phil
> > >
> > > I wrote:
> > >
> > > global arrayName
> > > upvar 0 $arrayName array
> > >
> > > because I wanted you to see the [global] explicitly, since the reason
your
> > > prior code wasn't working was that you were getting a list of global
> > > variables with [info globals], and then attempting to access them
without
> > > bringing them into the scope of your procedure.
> > >
> > > The same net result can be accomplished more succinctly with:
> > >
> > > upvar #0 $arrayName array
> > >
> > > Michael
> > >
> >
> > I'm sorry, but your explanation still makes no sense. I'm sure you're
> > explaining it as clearly as possible, but I'm blocked right now, nothing
you
> > said still makes sense to me.
> >
> > Phil
>
> You need to buy and read this book, at least:
>
> Practical Programming in Tcl and Tk (4th Edition)
> by Brent Welch (Author), Ken Jones (Author), Jeffrey Hobbs
>
> If you do not get some understanding for the whole it is a lot
> harder to make sence of the bits and pieces.
>
> marc

Let me add a bit more reference here. 4+ years TCL experience but in
Vignette - content management. So there are a LOT of TCL commands I simply
do not know how to use, such as upvar or variable or fconfigure, etc.
Because we in Vignette-land don't have to use them that often, I've never
understood specific commands. Since I am not in Vignette right now I am
having to learn it for the first time and so please be patient. I'm not at
your level, I admit it. I've read the online manuals on upvar and I still
don't fully understand it, period. I understand "global" but that's from my
PHP background: global simply puts the variable reference into the scope of
the proc so that the proc can use it.

Phil



Relevant Pages

  • Re: function and structures
    ... C code and i have to rewrite the code in TcL. ... is to assign to it with a set command (or some other commands such ... probably the best way is to use a Tcl array. ... Functions are declared with the proc command: ...
    (comp.lang.tcl)
  • Re: function and structures
    ... lines,, i want to implement the same in TcL. ... is to assign to it with a set command (or some other commands such ... probably the best way is to use a Tcl array. ... Functions are declared with the proc command: ...
    (comp.lang.tcl)
  • Re: Call flow - tcl - menu ivr - array as fsm? better than if?
    ... number i've dialed, execute the TCL script. ... TCL would play prompts and, in the end and if applicable, transfer the ... Router calls the tcl script that is located on a machine which is ... proc act_Setup { ...
    (comp.lang.tcl)
  • Re: Want to know when a batch file is done
    ... have the twapi extension. ... use a simple polling loop. ... proc wait-for-done {... ... The use of update gets around the single threaded tcl ...
    (comp.lang.tcl)
  • trace error
    ... But there is one thing I find curious and I would like to ask you, if there happens to be a part of the API (TCL or C) that I have overlooked. ... proc A { ... But if I want to make sure I am notified of every possible TCL error before the stack unwinds, I would have to wrap catch around every single proc in my program. ... In the same lines as "trace add variable" or "trace add command" can register procedures which are called before or after something happens to a variable or proc, "trace error callbackProc" would register the name of a proc to be called when an error occurres, before the stack unwinds, and would be executed in the same frame in which the error occurred. ...
    (comp.lang.tcl)