Update function to match test cases

This commit is contained in:
YuCheng Hu 2024-01-06 22:34:00 -05:00
parent 7cf7beb8f6
commit 9a1cbbe689
1 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,9 @@
; https://www.isharkfly.com/t/mumps-zip-code-validation/15227
R !,"Enter Zip:", address
D isValidZipCode(address,.error)
W !,error
Q
isValidZipCode(address,error)
S address = $EXTRACT(address,$LENGTH(address)-4,$LENGTH(address))
I (address'?5N) S error="error zip code" q 0
S error="" q 1