Ns adp include

From AOLserver Wiki
Revision as of 17:22, 25 June 2004 by WikiSysop (talk | contribs) (imported from WiKit id 191)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Man page: http://aolserver.com/docs/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

Category Documentation - Category Core Tcl API