perfect. And I get introduced to a meta tag I've never used.
thx.
On Saturday, January 29, 2005, at 05:38 PM, Robert Garcia wrote:
Since ordinal is an int, and not negative:
<@ifequal "<@var myNum>" "<@keep str='<@var myNum>' chars='0123456789'>">
Yay!
<@else>
Booh!
</@if>
-- Robert Garcia President - BigHead Technology VP Application Development - eventpix.com 13653 West Park Dr Paradise, Ca 95954 ph: 530.645.4040 x222 fax: 530.645.4040 [EMAIL PROTECTED] - [EMAIL PROTECTED] http://bighead.net/ - http://eventpix.com/ On Jan 29, 2005, at 5:17 PM, Bill Conlon wrote:
I want to verify that an input parameter is an ordinal number, i.e, it only contains the values [0-9]. In perl, the solution would be a regular expression, but the Witango <@REGEX> is a little cumbersome for something this simple task.
<@ISNUM> will do this if I set @@request$currencychar, @@request$decimalchar, and @@request$thouasandschar to "".
But, the manual states:
"Tip There is a significant performance benefit to a setting of true for this configuration variable. Use a setting of false only if you must support different numeric formats over the course of a single application file execution. "
It sure would be nice to avoid a performance hit just to validate input.
It looks like the answer is an object in custom scope, so that I instead set @@custom$currencychar, @@custom$decimalchar, and @@custom$thouasandschar to "", and then pass my parameter to a method in the custom scope.
Anyone have any other thoughts?
BTW, how does Witango handle the sign of a number? -$1,234.567 should be a valid number(with default numeric characters), but it doesn't look like it would pass the test of <@ISNUM> because of the minus sign.
Bill
______________________________________________________________________ __
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
--
Robert Garcia President - BigHead Technology VP Application Development - eventpix.com 13653 West Park Dr Paradise, Ca 95954 ph: 530.645.4040 x222 fax: 530.645.4040 [EMAIL PROTECTED] - [EMAIL PROTECTED] http://bighead.net/ - http://eventpix.com/
_______________________________________________________________________ _
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
