Flagging Letters and Numbers

Ken Ray kray at sonsothunder.com
Tue Jul 15 14:29:00 EDT 2003


Well, the isNumber() function will tell you if what you pass it is a
number or not. To determine if it is a character, you could do one of
the following:

1) Check it's ASCII value (97-122 is 'a-z', 65-90 is 'A-Z')

function isAlpha pChar
  put charToNum(pChar) into tNum
  return ((tNum >=65 and tNum <= 90) or (tNum >=97 and tNum <=122))
end isAlpha

2) Use a regular expression:

function isAlpha pChar
  return matchText(pChar,"[A-Za-z]")
end isAlpha

Personally, I prefer regular expressions, but that's me...

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/ 




> -----Original Message-----
> From: metacard-admin at lists.runrev.com 
> [mailto:metacard-admin at lists.runrev.com] On Behalf Of Gregory Lypny
> Sent: Tuesday, July 15, 2003 12:58 PM
> To: metacard at lists.runrev.com
> Subject: Flagging Letters and Numbers
> 
> 
> Hello everyone,
> 
> 	What's the best way to flag a character as a letter or number 
> (a,b,c,...,z,0,1,2,3,...) but nothing else?
> 
> 		Regards,
> 
> 			Greg
> 
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com 
> http://lists.runrev.com/mailman/listinfo/metac> ard
> 





More information about the metacard mailing list