[ Previous ] [ Contents ] [ Index ] [ Next ]

ns_adp_parse

Overview

Process an ADP file or string and return the result as a string

Syntax

ns_adp_parse -file [-global | -local] filename ?arg1? ?arg2? ?...?

ns_adp_parse -string [-global | -local] string ?arg1? ?arg2? ?...?

Description

This function processes the specified ADP file or string and returns the result as a string. If you need to process a second ADP from inside an ADP, it is usually better to use ns_adp_include, because that function resolves relative pathnames passed to it. Also note that ns_adp_parse will ignore any directives to turn on streaming.

If you use the -file syntax, the filename is the file containing the ADP to be parsed.

If you use the -string syntax, the string is a string containing ADP syntax to be parsed. Note that when you call ns_adp_parse with the -string syntax from inside an ADP, the string cannot contain the <% ... %> syntax.

If -global is specified, any Tcl commands in the ADP will be evaluated at the global level, with Tcl_GlobalEval.

If -local is specified, any Tcl commands in the ADP will be evaluated with Tcl_Eval.

If neither -global or -local is specified, the GlobalInclude configuration parameter determines the default. GlobalInclude is set to Off by default, meaning that Tcl commands will be evaluated locally.

You can pass optional arguments (arg1, arg2, etc.) to the ADP. The arguments can be accessed within the ADP using the ns_adp_argc, ns_adp_argv, and ns_adp_bind_args functions.

If this call is a nested ADP evaluation (where one ADP calls another), an error will be returned if the maximum number of nested ADP evaluations, determined by the MaxCallDepth parameter, has been exceeded.

Top of Page

[ Previous ] [ Contents ] [ Index ] [ Next ]
Copyright © 1996 America Online, Inc.