File tree 1 file changed +55
-0
lines changed
1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ Suppose software wants to check for the following FORMAT.
2
+ 99999-AAAAAAA-9
3
+
4
+ Where;
5
+ 9 is any number from 0 to 9
6
+ A is any letter from A to Z
7
+
8
+ -----CODE (with Rules Mentioned.)---------
9
+ Input NIC
10
+
11
+ 1. Check for Length
12
+ --------------------
13
+ If Len(NIC) <> 15 Then
14
+ output "Not Valid"
15
+ Exit
16
+ Endif
17
+
18
+ 2. Identify fixed positions and check for them
19
+ -----------------------------------------------
20
+ If MID(NIC,6,1) <> "-" OR _
21
+ MID(NIC,14,1) <> "-" Then
22
+
23
+ output "Not Valid"
24
+ Exit
25
+ Endif
26
+
27
+ 3. Identify Groups and check for them.
28
+ --------------------------------------
29
+ For Count = 1 to 5
30
+ Char=MID(NIC,Count,1)
31
+ If Char >= "0" AND Char <= "9"
32
+ Else
33
+ output "Not Valid"
34
+ Exit
35
+ Endif
36
+ Next Count
37
+
38
+ For Count = 7 to 13
39
+ Char=MID(NIC,Count,1)
40
+ If (Char >= "A" AND Char <= "Z") or (Char >= "a" AND Char <= "z")
41
+ Else
42
+ output "Not Valid"
43
+ Exit
44
+ Endif
45
+ Next Count
46
+
47
+ For Count = 15 to 15
48
+ Char=MID(NIC,Count,1)
49
+ If Char >= "0" AND Char <= "9"
50
+ Else
51
+ output "Not Valid"
52
+ Exit
53
+ Endif
54
+ Next Count
55
+ ---------CODE FINISHED--------------
You can’t perform that action at this time.
0 commit comments