Handbook
Glossary
v-max-length ( str n -- str )
Form validators
Prev:
v-min-length ( str n -- str )
Next:
v-min-value ( x n -- x )
Vocabulary
validators
Inputs
str
a
string
n
an
integer
Outputs
str
a
string
Word description
Throws a validation error if the string is longer than
n
characters.
Definition
USING:
kernel
make
math
math.parser
sequences
;
IN:
validators
:
v-max-length
( str n -- str )
over
length
over
>
[
[
"must be no more than "
%
#
" characters"
%
]
""
make
throw
]
[
drop
]
if
;