How to Check Number/ Letter Peoplecode
How to Check Number/ Letter Peoplecode function from input value. You can use this peoplecode function at below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
Function Check_Number(&STR) Returns boolean; &LEN = Len(&STR); If &LEN = 0 Then Return False; End-If; For &I = 1 To &LEN; &CODE = Code(Substring(&STR, &I, 1)); If (&CODE < 48 Or &CODE > 57) Then Return False; End-If; End-For; Return True; End-Function; Function Check_Letter(&STR) Returns boolean; &LEN = Len(&STR); If &LEN = 0 Then Return False; End-If; For &I = 1 To &LEN; &CODE = Code(Upper(Substring(&STR, &I, 1))); If (&CODE < 65 Or &CODE > 90) Then Return False; End-If; End-For; Return True; End-Function; |
Reference :http://www.compshack.com/peoplecode/peoplecode-check-number-and-check-letter-functions#comment-4979