Name

yesno — return Yes for non-empty input, No otherwise

DESCRIPTION

Return Yes (or it's locale-specific variant) on non-empty input (whitespace is considered non-empty too). Return No (or it's locale-specific variant) otherwise.

EXAMPLES

Example: Filter example

OK (yes)? [filter yesno]Good input[/filter]
OK (no)? [filter yesno][/filter]

          

Example: Reaching "yesno" decision after any whitespace is removed first

OK (yes)? [filter yesno]Good input[/filter]
OK (yes)? [filter yesno][/filter]
OK (no)? [filter strip yesno][/filter]

          

NOTES

AVAILABILITY

yesno is available in Interchange versions:

4.6.0-5.7.0 (git-head)

SOURCE

Interchange 5.7.0:

Source: code/Filter/yesno.filter
Lines: 20


# Copyright 2002-2007 Interchange Development Group and others
# Copyright 1996-2002 Red Hat, Inc.
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.  See the LICENSE file for details.
# 
# $Id: yesno.filter,v 1.4 2007-03-30 23:40:45 pajamian Exp $

CodeDef yesno Filter
CodeDef yesno Description 1/0 to Yes/No
CodeDef yesno Routine <<EOR
sub {
my $val = shift(@_) ? 'Yes' : 'No';
return $val unless $Vend::Cfg->{Locale};
return $val unless defined $Vend::Cfg->{Locale}{$val};
return $Vend::Cfg->{Locale}{$val};
}
EOR

AUTHORS

Interchange Development Group

SEE ALSO

noyes(7ic), ynzero(7ic)

DocBook! Interchange!