[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Omaha.pm] source code from 1992
Wow. Don't you love Perl? Below is Informix 4GL from 1992 I'm in today.
The perl version of the script below is:
/^\d{7}$/
What's my code reduction ratio there?
:)
j
#########################
FUNCTION valid_iata(ptxt)
#########################
# This Function determines whether the string passed in (ptxt) is all
Numbers#
DEFINE ptxt char(8),
tchar char(1),
i_flg integer,
i integer
LET i_flg = TRUE
FOR i = 1 to 7
LET tchar = ptxt[i,i]
IF tchar is NULL THEN
LET i_flg = FALSE
EXIT FOR
END IF
IF tchar NOT MATCHES "[1234567890]" THEN
LET i_flg = FALSE
EXIT FOR
END IF
END FOR
RETURN i_flg
END FUNCTION