ad_assert_arg_value_in_list (public, deprecated)

 ad_assert_arg_value_in_list arg_name allowed_values_list

Defined in packages/acs-bootstrap-installer/tcl/00-proc-procs.tcl

Deprecated. Invoking this procedure generates a warning.

For use at the beginning of the body of a procedure to check that an argument has one of a number of allowed values.

Parameters:
arg_name - The name of the argument to check
allowed_values_list - The list of values that are permissible for the argument Deprecated: this proc can be replaced via very simple expr or if idioms
Returns:
Returns 1 if the argument has a valid value, throws an informative error otherwise.
Author:
Peter Marklund

See Also:
  • native if or expr idioms

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.
Source code:
ns_log Notice "Deprecated proc ad_assert_arg_value_in_list used:\n[ad_get_tcl_call_stack]"

    upvar $arg_name arg_value

    if {$arg_value ni $allowed_values_list} {
        error "argument $arg_name has value $arg_value but must be in ([join $allowed_values_list ""])"
    }

    return 1
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: