On Friday 14 March 2003 17:49, you wrote:
> I placed this file in server/modules/tcl/hello.tcl
>
> set hello "Hello %s"
>
> ns_register_proc GET /hello howdy
> proc howdy {conn context} {
>     global hello
>     ns_return [format $hello "Jeremy"]
> }
>
> When I access, /hello I recieve:
>
> [14/Mar/2003:11:16:20][17125.65541][-conn:server1::0] Error: can't read
> "hello": no such variable
> can't read "hello": no such variable
>     while executing
> "format $hello "Jeremy""
>     (procedure "howdy" line 3)
>     invoked from within
> "howdy cns0 {}"
>
> Can anyone help me out? I'm not certian what I am doing wrong.


You should not pollute the global namespace with variables.
Those are being removed (cleansed) from the interp during
normal server operation.
If you really like to do that, then do:

namespace eval myvars {
    variable hello "Hello %s"
}
ns_register_proc GET /hello howdy
proc howdy {conn context} {
    ns_return [format [set myvars::hello] "Jeremy"]
}

Cheers,
Zoran



I. To remove yourself from this list:

Send a message to "[EMAIL PROTECTED]"  with the following text in
the BODY of your message:

signoff aolserver

II. For a complete list of listserv options please visit:

http://listserv.aol.com/

III. For more AOLserver information please visit:

http://www.aolserver.com/

Reply via email to