Post Reply 
Year(s) Month(s) Day(s) between 2 dates
10-19-2015, 09:33 AM
Post: #1
Year(s) Month(s) Day(s) between 2 dates
Hi, I've ported routine of mine from HP41cx to WP34s. Off course it's programmed "à la 41". I wonder if it's a way to load in one list the "31 STO 01 STO 03 etc.", I've check anywhere but I don't find. If it's possible, code will be less longer and speed up. All comments or ideas will be welcome. This routine is precise because we work with really numbers of days into month.

Do XEQ'YMD', ENTER DATE 1 RS (NOT ENTER !) DATE 2 RS (NOT ENTER !)
Enjoy.

Gérard.
Code:

01 LBL'YMD'
02 SSIZE8
03 FIX04
04 CLREGS
05 CLSTK
06 CL[alpha]
07 3
08 1
09 STO 01
10 STO 03
11 STO 05
12 STO 07
13 STO 08
14 STO 10
15 STO 12
16 2
17 8
18 STO 02
19 3
20 0
21 STO 04
22 STO 06
23 STO 09
24 STO 11
25 CLx
26 [alpha]'Ent'
27 [alpha]'er '
28 [alpha]'Dat'
29 [alpha]'e 1'
30 PROMPT
31 DATE->
32 RCL Z
33 LEAP?
34 XEQ 00
35 DROP
36 CL[alpha]
37 [alpha]'Ent'
38 [alpha]'er '
39 [alpha]'Dat'
40 [alpha]'e 2'
41 PROMPT
42 DATE->
43 RCL T
44 -
45 x<0?
46 XEQ 01
47 x<>y
48 RCL A
49 -
50 R[up]
51 -
52 0
53 STO D
54 DROP
55 x<0?
56 EXQ 02
57 RCL Z
58 R[up]
59 -
60 R[up]
61 -
62 x<>Z
63 SDR 002
64 +
65 SDR 002
66 +
67 RTN
68 LBL 00
69 2
70 9
71 STO 02
72 DROP
73 RTN
74 LBL 01
75 RCL->A
76 +
77 1
78 STO D
79 DROP
80 RTN
81 LBL 02
82 1
83 STO D
84 DROP
85 1
86 2
87 +
88 RTN
89 -END-

"Voilà".

As an example :


Well, if you use this routine crossing switch Julian Gregorian, keep in mind to minus result for 10 days : DATE1 = 3.101582 DATE2 = 18.101582 DISPLAY 15 days, but only 15-10 = 5 days !

(I hope my english is better since I've an english methode !)

A good day for all.

Gérard.

Gérard.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Year(s) Month(s) Day(s) between 2 dates - ggauny@live.fr - 10-19-2015 09:33 AM



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