|
-
Mar 30th, 2007, 02:20 PM
#1
Thread Starter
Member
Check for uppercase? [RESOLVED]
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?
Last edited by BIGGY; Mar 30th, 2007 at 04:29 PM.
-
Mar 30th, 2007, 04:26 PM
#2
Thread Starter
Member
Re: Check for uppercase?
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;
Last edited by BIGGY; Mar 30th, 2007 at 04:39 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|