Click to See Complete Forum and Search --> : Check for uppercase? [RESOLVED]
BIGGY
Mar 30th, 2007, 02:20 PM
I'm looking to write a formula that checks to see if a field uses only numbers and capital letters. It's basically making sure that the invoice number is entered correctly. Any combination of letter and numbers is ok, so long as all the letters are upper case. I see the 'uppercase' function but not sure it can do what I'm trying to accomplish. Any ideas?
BIGGY
Mar 30th, 2007, 04:26 PM
Well I finally figured it out. Man this took much longer than I thought for such a simple thing, but I guess my mind works slowly :)
stringvar x;
numbervar i;
stringvar z;
numbervar strLen;
global stringvar UCaseCheck := 'Pass';
strLen := len({Command.Invoice Number});
x := totext({Command.Invoice Number});
z := totext({Command.Invoice Number});
ucase(x);
For i := 1 to strLen Do
(
Local NumberVar charPos := i;
if AscW(x[charPos]) <> AscW(z[charPos]) then UCaseCheck := 'Fail';
);
UCaseCheck;
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.