-- DateAndTimeTest.mesa -- last edited by Levin on August 24, 1982 12:00 pm DIRECTORY Ascii USING [CR], DateAndTimeUnsafe USING [Notes, Parse, Unintelligible], Exec USING [w], System USING [GreenwichMeanTime], TTY USING [GetString, PutChar, PutCR, PutDate, PutDecimal, PutLongNumber, PutString]; DateAndTimeTest: PROGRAM IMPORTS DateAndTimeUnsafe, Exec, TTY = BEGIN DO s: STRING _ [100]; t: PROCEDURE [c: CHARACTER] RETURNS [yes: BOOLEAN] = { RETURN [c = Ascii.CR] }; gmt: System.GreenwichMeanTime; notes: DateAndTimeUnsafe.Notes; length: NAT; TTY.PutString[Exec.w, "Date: "]; TTY.GetString[Exec.w, s, t]; IF s.length = 0 THEN EXIT; [gmt, notes, length] _ DateAndTimeUnsafe.Parse[s ! DateAndTimeUnsafe.Unintelligible => { TTY.PutString[Exec.w, " Parse failed at pos "]; TTY.PutDecimal[Exec.w, vicinity]; IF vicinity < s.length THEN { TTY.PutString[Exec.w, "(next char is '"L]; TTY.PutChar[Exec.w, s[vicinity]]; TTY.PutString[Exec.w, "')"L]; }; TTY.PutCR[Exec.w]; LOOP}]; TTY.PutString[Exec.w, " = "]; TTY.PutLongNumber[Exec.w, gmt, [10, FALSE, TRUE, 12]]; SELECT notes FROM noTime => TTY.PutString[Exec.w, " (no time)"]; timeAndZoneGuessed => TTY.PutString[Exec.w, " (time and zone guessed)"]; noZone => TTY.PutString[Exec.w, " (no zone)"]; zoneGuessed => TTY.PutString[Exec.w, " (zone guessed)"]; ENDCASE; TTY.PutString[Exec.w, " = "]; TTY.PutDate[Exec.w, gmt, full]; TTY.PutCR[Exec.w]; TTY.PutString[Exec.w, " Parse stopped at position "L]; TTY.PutDecimal[Exec.w, length]; TTY.PutCR[Exec.w]; ENDLOOP; END. Κ”– "Mesa" style˜JšΟc˜Jš3˜3šΟk ˜ Jšœžœ˜Jšœžœ ˜7Jšœžœ˜Jšœžœ˜!JšœžœL˜U—J˜šœž˜Jšžœ˜&—Jšž˜šž˜Jšœžœ ˜procš œž œž œžœžœ˜6Jšžœ˜J˜—J˜J˜Jšœžœ˜ J˜ J˜Jšžœ žœž˜˜XJšœ0˜0Jšœ!˜!šœ˜Jšœ*˜*Jšœ!˜!Jšœ˜Jšœ˜—Jšœ˜Jšžœ˜—J˜Jšœ$žœžœ˜6šžœž˜J˜.J˜HJ˜.J˜8Jšžœ˜—J˜J˜J˜J˜9J˜J˜Jšž˜—Jšžœ˜J˜—…—μ†