Thanks for the answer Bas.

I have done this now: set ::variablename value

in adp: if {$::variablename} {
   blah
}

so it works now, but I have no idea as to why I should explicitly add
the :: for this to work. The tcl code runs in a function which has
been registered like this: ns_register_filter postauth.

Thank you

On 16/03/2008, Bas Scheffers <[EMAIL PROTECTED]> wrote:
> The correct way to just access a variable is:
>
>  <%= $variable %>
>
>  No need for "puts". This works also:
>
>  <%= [clock seconds] %>
>
>  Which puts the output of that command in the HTML.
>
>  But it sounds like you have a scope problem. Any way you can post your
>  actual code?
>
>  If you set the variable inside a procedure, you could use "upvar" to
>  make it available in the scope where you want to display it. If you
>  put a variable in the global scope, you can access it like so:
>
>  <%= $::variable %>
>
>  Bas.
>
>
>  On 16/03/2008, at 8:40 AM, Xavier Bourguignon wrote:
>
>  > Hi,
>  >
>  > I have a variable set in my tcl code. e.g: set uname "myuname"
>  >
>  > how do I use this in my adp page?. e.g: Your username is: <%puts
>  > $uname%>
>  >
>  > It does not seem to work, everytime i get a tcl error saying that
>  > uname does not exists. I tried to make uname global, to no avail.
>  >
>  > Thank you
>  >
>  > --
>  > Xavier Bourguignon
>  >
>  >
>
> > --
>  > AOLserver - http://www.aolserver.com/
>  >
>  > To Remove yourself from this list, simply send an email to <[EMAIL 
> PROTECTED]
>  > > with the
>  > body of "SIGNOFF AOLSERVER" in the email message. You can leave the
>  > Subject: field of your email blank.
>
>
>
>  --
>  AOLserver - http://www.aolserver.com/
>
>  To Remove yourself from this list, simply send an email to <[EMAIL 
> PROTECTED]> with the
>  body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
> field of your email blank.
>


-- 
Xavier Bourguignon


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to