Difference between revisions of "Ns adp argv"

From AOLserver Wiki
Jump to navigation Jump to search
(imported from WiKit id 856)
 
 
Line 5: Line 5:
 
'''NAME'''
 
'''NAME'''
  
: ns_adp_argv - Return the number of arguments to the current ADP
+
: ns_adp_argv - Return the list of arguments to the current ADP or a specified argument by index.
  
 
'''SYNOPSIS'''
 
'''SYNOPSIS'''
  
: '''ns_adp_argv''' ''?index?''
+
: '''ns_adp_argv''' ''?index?'' ''?default?''
  
 
'''DESCRIPTION'''
 
'''DESCRIPTION'''
  
: This command returns a list of arguments to the current ADP, including the name of the ADP itself as the first element.  If ''index'' is specified, only that element from the list is returned.
+
: This command returns a list of arguments to the current ADP, including the name of the ADP itself as the first element.  If ''index'' is specified, only that element from the list is returned. If the optional ''default'' argument is specified along with an ''index'' argument, it serves as the value to return if the corresponding parameter was not passed to the call frame.
  
 
'''EXAMPLES'''
 
'''EXAMPLES'''
Line 25: Line 25:
 
       ns_adp_argv 0    ;# => b.adp
 
       ns_adp_argv 0    ;# => b.adp
 
       ns_adp_argv 4    ;# => c
 
       ns_adp_argv 4    ;# => c
 +
      ns_adp_argv 5 d  ;# => d
 
     %>
 
     %>
  

Latest revision as of 00:45, 14 June 2010

Man page: http://aolserver.com/docs/tcl/ns_adp_argv.html


NAME

ns_adp_argv - Return the list of arguments to the current ADP or a specified argument by index.

SYNOPSIS

ns_adp_argv ?index? ?default?

DESCRIPTION

This command returns a list of arguments to the current ADP, including the name of the ADP itself as the first element. If index is specified, only that element from the list is returned. If the optional default argument is specified along with an index argument, it serves as the value to return if the corresponding parameter was not passed to the call frame.

EXAMPLES

   # In a.adp:
   <% ns_adp_include b.adp example a b c %>
   # In b.adp:
   <%
     ns_adp_argv       ;# => b.adp example a b c
     ns_adp_argv 0     ;# => b.adp
     ns_adp_argv 4     ;# => c
     ns_adp_argv 5 d   ;# => d
   %>

SEE ALSO

ns_adp_abort, ns_adp_append, ns_adp_argc, 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_include, 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