Difference between revisions of "Ns adp include"

From AOLserver Wiki
Jump to navigation Jump to search
(imported from WiKit id 191)
 
(formatting tweaks, fix example)
Line 1: Line 1:
Man page: http://aolserver.com/docs/tcl/ns_adp_include.html
+
{{manpage|ns_adp_include}}
 
 
----
 
  
 
'''NAME'''
 
'''NAME'''
Line 23: Line 21:
 
'''EXAMPLES'''
 
'''EXAMPLES'''
  
 +
<pre>
 
     ###
 
     ###
 
     ### Example #1: Callee outputs directly to ADP output buffer.
 
     ### Example #1: Callee outputs directly to ADP output buffer.
Line 38: Line 37:
  
 
     # In a.adp:
 
     # In a.adp:
     <% ns_adp_puts [[ns_adp_include b.adp]] %>
+
     <% ns_adp_puts [ns_adp_include b.adp] %>
  
 
     # In b.adp:
 
     # In b.adp:
 
     <% return "Hello, world!" %>
 
     <% return "Hello, world!" %>
 +
</pre>
  
 
'''SEE ALSO'''
 
'''SEE ALSO'''
Line 47: Line 47:
 
: [[ns_adp_abort]], [[ns_adp_append]], [[ns_adp_argc]], [[ns_adp_argv]], [[ns_adp_bind_args]], [[ns_adp_break]], [[ns_adp_debug]], [[ns_adp_debuginit]], [[ns_adp_dir]], [[ns_adp_dump]], [[ns_adp_eval]], [[ns_adp_exception]], [[ns_adp_mime]], [[ns_adp_mimetype]], [[ns_adp_parse]], [[ns_adp_puts]], [[ns_adp_registeradp]], [[ns_adp_registerproc]], [[ns_adp_registertag]], [[ns_adp_return]], [[ns_adp_safeeval]], [[ns_adp_stats]], [[ns_adp_stream]], [[ns_adp_tell]], [[ns_adp_trunc]]
 
: [[ns_adp_abort]], [[ns_adp_append]], [[ns_adp_argc]], [[ns_adp_argv]], [[ns_adp_bind_args]], [[ns_adp_break]], [[ns_adp_debug]], [[ns_adp_debuginit]], [[ns_adp_dir]], [[ns_adp_dump]], [[ns_adp_eval]], [[ns_adp_exception]], [[ns_adp_mime]], [[ns_adp_mimetype]], [[ns_adp_parse]], [[ns_adp_puts]], [[ns_adp_registeradp]], [[ns_adp_registerproc]], [[ns_adp_registertag]], [[ns_adp_return]], [[ns_adp_safeeval]], [[ns_adp_stats]], [[ns_adp_stream]], [[ns_adp_tell]], [[ns_adp_trunc]]
  
----
+
[[Category:Core Tcl API]]
 
 
[[Category Documentation]] - [[Category Core Tcl API]]
 

Revision as of 17:48, 5 December 2005

Man page: http://aolserver.com/man/4.0/tcl/ns_adp_include.html


NAME

ns_adp_include - Parse an ADP file and return its output

SYNOPSIS

ns_adp_include file ?args ...?

DESCRIPTION

This command reads file and parses its contents as an ADP and returns the output to the caller. file is relative to the caller's directory unless an absolute pathname is used. Optional args can be passed which are accessed using ns_adp_argc, ns_adp_argv and ns_adp_bind_args commands in the callee.
Note that ADP streaming cannot be turned on using ns_adp_stream from within an ADP executed with the ns_adp_include command. Tcl commands in the ADP will be evaluated in a new scope.
ADPs can be nested by including each other up to the maximum of 256 levels deep.
This command is only available from an ADP. Use ns_adp_parse to parse ADPs from outside the context of an ADP.

EXAMPLES

    ###
    ### Example #1: Callee outputs directly to ADP output buffer.
    ###

    # In a.adp:
    <% ns_adp_include b.adp %>

    # In b.adp:
    <% ns_adp_puts "Hello, world!" %>

    ###
    ### Example #2: Caller outputs to ADP buffer.
    ###

    # In a.adp:
    <% ns_adp_puts [ns_adp_include b.adp] %>

    # In b.adp:
    <% return "Hello, world!" %>

SEE ALSO

ns_adp_abort, ns_adp_append, ns_adp_argc, ns_adp_argv, ns_adp_bind_args, ns_adp_break, ns_adp_debug, ns_adp_debuginit, ns_adp_dir, ns_adp_dump, ns_adp_eval, ns_adp_exception, ns_adp_mime, ns_adp_mimetype, ns_adp_parse, ns_adp_puts, ns_adp_registeradp, ns_adp_registerproc, ns_adp_registertag, ns_adp_return, ns_adp_safeeval, ns_adp_stats, ns_adp_stream, ns_adp_tell, ns_adp_trunc