Previous: prscol Up: ../plot79_p.html Next: prsdel
INTEGER FUNCTION PRSDAY (STATUS, STDHMS, HLPSTR, LENHLP, DEFSTR,
X LENDEF, OPTION)
C$ (Parse - Daytime)
C$ Parse a daytime (date and/or time) field, leaving it in
C$ COMMON. The arguments are:
C$
C$ STATUS.........Parsing status value (and function value)
C$ returned; one of EOF, NOPABT, NOPHLP,
C$ NOPIDT, NOPIFL, NOPNUL, NOPUNK, OKAY,
C$ OVRFLO, or REPARS. The help return, NOPHLP,
C$ is only given if an alternative parse is in
C$ progress. Otherwise, this routine loops
C$ until the user completes the input field
C$ with something other than the help
C$ character.
C$ STDHMS......... .TRUE. - issue standard help message.
C$ .FALSE. - suppress standard help message.
C$ HLPSTR(*)......Packed Hollerith help string.
C$ LENHLP.........Length of HLPSTR(*).
C$ DEFSTR(*)......Packed Hollerith default value string.
C$ LENDEF.........Length of DEFSTR(*).
C$ OPTION.........Integer option code. Set to one or more of
C$ (DATE,TIME). Add option codes if more than
C$ one is required.
C$
C$ A legal date field is
C$
C$ <pos-int-day><-><monthname><-><pos-int-year>
C$
C$ where the number of days must be correct for the given
C$ month (allowing for leap years every four years except in
C$ century years), and the monthname may be abbreviated to any
C$ unique prefix. If the year is in the range 0..99, 1900 is
C$ automatically added to it, unless at least three digits are
C$ specified to force a date in the first century (e.g.
C$ 1-Jan-0003). On a successful parse, STRVAL(*) contains the
C$ input date string, and INTVAL(1)..INTVAL(5) contain the
C$ year (0..MAXINT), month (1..12), day (1..31), weekday (1..7
C$ for Sunday..Saturday), and day of year (1..366),
C$ respectively. The latter two are correct only if the date
C$ is one in the Gregorian calendar (after October 15, 1582 in
C$ the Catholic world, after September 14, 1752 in England and
C$ its colonies, after 1917 in the Soviet Union).
C$
C$ A legal time field is
C$
C$ <pos-int-hh><:><pos-int-mm>[<:><pos-int-ss>]
C$
C$ where hh is in the range 0..23, and mm and ss in 0..59. An
C$ omitted ss defaults to 0. On a successful parse, STRVAL(*)
C$ contains the input time string (possibly preceded by a date
C$ string separated from it by a blank), and
C$ INTVAL(6)..INTVAL(8) contain hh, mm, and ss respectively.
C$
C$ The weekday algorithm is taken from the Collected
C$ Algorithms of the ACM, Algorithm 398, Richard A. Stone,
C$ "Tableless Date Conversion", (October, 1970).
C$ (10-OCT-84)