home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
300-399
/
ff335.lzh
/
DTC
/
stmtfunc.for
< prev
next >
Wrap
Text File
|
1990-03-22
|
1KB
|
32 lines
c Useful statement functions:
c 1) type checking of single character
c 2) quick binary to 2-digit bcd conversion, and vice versa
c 3) Check for leap-year (Gregorian)
c 4) Hashdate for DTC appointment matching
c
c ! Character type checking
numeric(ch) = (ch .GE. 48) .AND. (ch .LE.57)
chnumeric(chch) = (chch .GE. '0') .AND. (chch .LE. '9')
lcalpha(ch) = (ch .GE.97) .AND. (ch .LE.122)
alpha(ch)=((ch.ge.65.and.ch.le.90).or.(ch.ge.97.and.ch.le.122))
c alpha(ch) = ((ch .AND. Z'5f5f5f5f') .GE.65)
c 1 .AND. ((ch .AND. Z'5f5f5f5f') .LE. 90)
c
c Icvtbcd now unused
c Icvtbin replaced by real function in dtc.for
c
c icvtbcd(inum) = ((MOD(inum, 10) * 256) .OR. inum/10) .OR. '00'
c icvtbin(ich2) = ((ich2 .AND. Z'000F') * 10)
c 1 + ((ich2 .AND. Z'0F00')/256)
c ! Works w/space as first char
c icvtbn1(ch) = ch .AND. Z'0F'
c ! Convert single character
c
islpyr(izyr) = (mod(izyr, 400) .EQ. 0) .OR.
1 ((izyr .AND. 3) .EQ. 0) .AND. (mod(izyr, 100) .NE. 0)
c
ihymd(izyr, izmo, izdy) = (((izyr * 16) + izmo) * 32) + izdy
c
c End statement functions