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 ad_log_deprecated ad_log_deprecated (public) ad_assert_arg_value_in_list ad_assert_arg_value_in_list ad_assert_arg_value_in_list->ad_log_deprecated

Testcases:
No testcase defined.
Source code:
ad_log_deprecated proc ad_assert_arg_value_in_list
    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: