Each Tcl block is parsed individually. As such, they need to be self
contained. Your best bet is to do something along the lines of:
<div>
<%
if {[call_tcl_proc_here]} {
ns_adp_puts "The result is 1<br>"
} else {
ns_adp_puts "The result is 0"
}
%>
</div>
Or, if the blocks that would be in the ns_adp_puts section are large,
break them out into separate files and use:
<div>
<%
if {[call_tcl_proc_here]} {
ns_adp_include "file1.inc"
} else {
ns_adp_include "file2.inc"
}
%>
</div>
There choice to have each Tcl block independent is one that, I believe,
has been discussed multiple times by folks much smarter than myself. The
end result is that, while it has it's costs in certain ways, it also has
certain benefits. For example, you can "return" from a Tcl block and
continue on in the page at the end of that block.
Robert Seeger
Xavier Bourguignon wrote:
Hi All,
I am just starting to use adp files and I want to ask if the following
code is possible:
<div>
<% if {[call_tcl_proc_here]} { %>
The result is 1<br>
<% } else { %>
The result is 0
<% } %>
</div>
I am asking this because when I run this I get a tcl error saying:
missing close-brace
How can this be?
Thank you
--
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.