1 # Copyright 2005-2007 Interchange Development Group and others
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version. See the LICENSE file for details.
8 # $Id: natural.oc,v 1.4 2008-04-28 12:08:38 docelic Exp $
10 CodeDef natural OrderCheck
11 CodeDef natural Description Natural number
12 CodeDef natural Routine <<EOR
14 my ($ref, $name, $value, $code) = @_;
16 if ($value and $value > 0 and "$value" eq int($value)) {
17 return (1, $name, '');
21 $code =~ s/^\s*(["'])(.+?)\1$/$2/;
24 return (0, $name, $code);
26 return (0, $name, 'no natural number');