Forum OpenACS Q&A: Response to tcllib nntp

Collapse
5: Response to tcllib nntp (response to 1)
Posted by James Thornton on
To fix this, you need to reuse the news handle when you source the page again.

Dan - With the following code in a standard Tcl page, I can see that NH is reset with every page load -- its value will keep incrementing as nntp1...nntp17, nntp18, etc. Aren't global variables are only global inside the context of a page, thus losing their values after the page loads?

global NH

if {![info exists NH]} {
    set NH [::nntp::nntp]
    set handle_html "Reseting handle to: $NH
" } set date [$NH date] ns_write " $handle_html Date: $date "