NaviServer Programmable Web Server

ns_adp_argv(n)

NaviServer Built-in Commands – 5.1.0


[ Main Table Of Contents | Table Of Contents | Keyword Index ]

Name

ns_adp_argv - Return the arguments to the current (included) ADP

Table Of Contents

Synopsis

Description

This command returns the list of arguments passed to the current ADP invocation. The arguments are typically provided via ns_adp_include.

COMMANDS

ns_adp_argv ?index? ?default?

When called without index and default, the full argument list is returned.

When the optional index is specified, the command returns only the element at that position (starting with 0). If the index is out of range, the optional default value is returned. If no default is provided, an empty string is returned.

EXAMPLES

 # In a.adp:
 <% ns_adp_include b.adp example a b c %>
 # In b.adp:
 <%
   ns_adp_argv      ;# => example a b c
   ns_adp_argv 0    ;# => example
   ns_adp_argv 3    ;# => c
   ns_adp_argv 10 X ;# => X
 %>

See Also

ns_adp_argc, ns_adp_bind_args, ns_adp_include, ns_adp_parse

Keywords

ADP, server built-in