Post Reply 
(Free42) UNTIL - How long until...?
10-22-2018, 01:40 PM
Post: #1
(Free42) UNTIL - How long until...?
This program uses the date/time functions of Free42, and thus will not work with a "real" 42S. It will, however, work on a DM42, which is where I wrote/use it.

UNTIL will tell you how many days and/or hours/minutes/seconds until some specified date/time. It's mostly just some convenience UI around DDAYS, HMS-, etc.

Run UNTIL, then use the Up and Down keys to choose one of the three menus based on whether you're comparing time, date, or both. Enter a value, and press DATE or TIME to set the reference date/time. Then press HMS, DAYS, or D,HMS to calculate the time remaining until the time/date entered, with results in hours/minutes/seconds, decimal days, or days (y) + hours/minutes/seconds (x) respectively.

Example:

How long until 8:00 AM Christmas day, 2018?

XEQ "UNTIL"
Up
12.252018 [DATE]
8.00 [TIME]
[D,HMS]
y: 63
x: 22.260972

63 days, 22 hours, 26 minutes, 9.72 seconds (results will obviously vary depending on when you run this).

Code:
00 { 324-Byte Prgm }
01▸LBL "UNTIL"
02▸LBL 01
03 SF 81
04 CF 82
05 CLMENU
06 "TIME"
07 KEY 1 XEQ 11
08 KEY 7 GTO 03
09 KEY 8 GTO 02
10 GTO 08
11▸LBL 02
12 CF 81
13 SF 82
14 CLMENU
15 "DATE"
16 KEY 1 XEQ 12
17 KEY 7 GTO 01
18 KEY 8 GTO 03
19 GTO 08
20▸LBL 03
21 SF 81
22 SF 82
23 CLMENU
24 "DATE"
25 KEY 1 XEQ 12
26 "TIME"
27 KEY 2 XEQ 11
28 KEY 7 GTO 02
29 KEY 8 GTO 01
30▸LBL 08
31 "HMS"
32 KEY 4 XEQ 14
33 "DAYS"
34 KEY 5 XEQ 15
35 "D,HMS"
36 KEY 6 XEQ 16
37▸LBL 07
38 MENU
39 STOP
40 GTO 07
41▸LBL 11
42 STO "TM"
43 RTN
44▸LBL 12
45 STO "DT"
46 RTN
47▸LBL 14
48 XEQ 20
49 →HMS
50 GTO 91
51▸LBL 15
52 XEQ 20
53 24
54 ÷
55▸LBL 91
56 RCL "U_L"
57 STO ST L
58 R↓
59 RCL "U_Z"
60 RCL "U_Y"
61 RCL "U_X"
62 R↑
63 GTO 99
64▸LBL 16
65 XEQ 20
66 ENTER
67 ENTER
68 24
69 ÷
70 IP
71 X<>Y
72 24
73 RCL× ST Z
74 -
75 →HMS
76 RCL "U_L"
77 STO ST L
78 R↓
79 RCL "U_Y"
80 RCL "U_X"
81 R↓
82 R↓
83 GTO 99
84▸LBL 20
85 XEQ 90
86 0
87 FC? 82
88 GTO 21
89 DATE
90 RCL "DT"
91 DDAYS
92 24
93 ×
94 +
95▸LBL 21
96 FC? 81
97 RTN
98 RCL "TM"
99 →HR
100 TIME
101 →HR
102 -
103 +
104 RTN
105▸LBL 90
106 STO "U_X"
107 X<> ST L
108 STO "U_L"
109 X<> ST L
110 R↓
111 STO "U_Y"
112 R↓
113 STO "U_Z"
114 R↓
115 R↓
116 RTN
117▸LBL 99
118 CLV "U_Z"
119 CLV "U_Y"
120 CLV "U_X"
121 CLV "U_L"
122 END


.zip  Until.zip (Size: 411 bytes / Downloads: 12)
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)