So Bob, what is the difference between setting the variable within the
adp and setting it in a procedure? Surely the variable set in the
procedure should be available as the procedure is called within the
adp.


Tom, what templating system do you use? How do you use it? any links
for a noob like me to learn?

thank you

On 20/04/2008, Robert Seeger <[EMAIL PROTECTED]> wrote:
>
>  It might help to consider each adp page (or include'd page) as a tcl proc.
> As such, if you define the variable on the page, it will be visible there:
>
>
> <html>
>    <head></head>
>    <%
>    set bob 1
>    %>
>    <body>
>      <!-- the following will both work -->
>      <%= $bob %>
>      <% ns_adp_puts $bob %>
>    </body>
>  </html>
>
>  However, things defined in other pages/includes or other procs would need
> to be global to be accessed.
>
>  Rob Seeger
>
>
>  Xavier Bourguignon wrote:
>  <html>
>  <head>
>  </head>
>  <body>
>  <%proc_call%>
>  <h1><%ns_adp_puts $varname%></h1>
>  </body>
> </html>
>
> Unless varname is global in proc_call, then it seems that varname is
> unknown to the tcl interpreter.
>
> How do you get away with not using adps? They are the building blocks
> of dynamic pages aren't they?
>
> Thanks
>
> On 19/04/2008, Tom Jackson <[EMAIL PROTECTED]> wrote:
>
>
>  On Saturday 19 April 2008 12:52, Xavier Bourguignon wrote:
>  > Hi,
>  >
>  > In one of my adp files I want to display the value of a tcl variable,
>  > so I do this <%=$varname%>
>  >
>  > My problem is that I can only see the value when my varname is set to
>  > global in my tcl script?
>  >
>  > My question is: Why does the variable have to be a global? can't I do
>  > set varname varvalue and then use in my adp?
>  >
>  > Thank you
>
>
> Can you give a complete and simple example of what _doesn't_ work?
>
>  I don't use adps very often, but I never noticed a problem with using local
>  variables.
>
>  tom jackson
>
>
>
>  --
>  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