ad_page_contract_filter_proc_string_length (public)

 ad_page_contract_filter_proc_string_length name value_varname length

Defined in packages/acs-tcl/tcl/tcl-documentation-procs.tcl

Checks whether the string is less or greater than the minimum or maximum length specified, inclusive e.g.address_1:notnull,string_length(max|100) will test address_1 for maximum length of 100.

Parameters:
name
value_varname
length
Author:
Randy Beggs <randyb@arsdigita.com>
Created:
August 2000

Partial Call Graph (max 5 caller/called nodes):
%3 test_ad_page_contract_filters ad_page_contract_filters (test acs-tcl) ad_page_contract_filter_proc_string_length ad_page_contract_filter_proc_string_length test_ad_page_contract_filters->ad_page_contract_filter_proc_string_length _ _ (public) ad_page_contract_filter_proc_string_length->_ ad_complain ad_complain (public) ad_page_contract_filter_proc_string_length->ad_complain

Testcases:
ad_page_contract_filters
Source code:
upvar $value_varname value

    set actual_length [string length $value]
    lassign $length op nr
    if { $op eq "min" } {
        if { $actual_length < $nr } {
            set binding [list name $name actual_length $actual_length min_length $nr]
            ad_complain [_ acs-tcl.lt_name_is_too_short__Pl_1]
            return 0
        }
    } else {
        if { $actual_length > $nr } {
            set binding [list name $name actual_length $actual_length max_length $nr]
            ad_complain [_ acs-tcl.lt_name_is_too_long__Ple_1 $binding]
            return 0
        }
    }
    return 1
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: