I currently am programming a recently aquired HP 42S with as many of my HP41Cx programs as possible.
Of course some need minor conversions to be adaptable but there is one function missing on the HP42S that the HP41cx has that I am having problems with.
I have a schedule program which, after running the HP41cx and the infared printer will output a rest schedule formatted for the printer. The program allows you to:
with the input of:
a. start time (24 hour clock, gmt)
b. finish time
c. number of breaks during the time period
d. enter a known 'long' period if you choose
e. enter a known 'short' period instead of the long period;
ex. I want the short period to be 1 hour and the rest to be
the long period or,
I want the long period to be 2 hours and the rest to be
the short (the following example).the output is:
a. listing the start time and finish time
b. calculating the total time available
c. i. dividing that into equal periods based on the number of
breaksor
ii. creating a schedule based on 2 short periods followed by 3
long periods followed by a short period.
(either the short or long periods can be pre defined to
create the above schedule; see above)For example:
START= 22:35
END= 06:25
NUMBER OF BREAKS= 6
LONG BREAK= 2:00
and a selection of 2 short periods followed by 3 long followed by
one short (case ii above). This gives the following PRINTER
output:
START= 22:35
END= 06:25TOTAL= 07:50
LONG= 02:00
SHORT= 00:36# BREAKS= 6
22:35__23:11
23:11__23:48
23:48__01:48
01:48__03:48
O3:48__05:48
O5:48__06:25
The problem is the HP41CX has a wonderful all in one command that formats a decimal such as 6.25 into the alpha display 06:25. This command is the "ATIME" command. The HP42S has no such command and therefore I have to come up with a subroutine which will format the decimal HMS display to the clock time display.
I of course will call it LBL "ATIME" but currently being unfamiliar with the 42S am having a problem hacking a solution. As it stands the output is in decimal HMS mode and looks like this:
HP 42S output to the printer:
Start= 22.35
End= 6.25Total= 7.50
Long= 2.00
Short= 0.36# Breaks= 6
22.35__23.11
23.11__23.48
23.48__1.48
1.48__3.48
3.48__5.48
5.48__6.25
As you can see it does not line up as the preceding '0' is missing from the 3 digit time calculations. "ATIME" pre-attached the '0' to these digits.
Now I know how to test the 6.25 via alength and can send the offending time codes to the "ATIME" subroutine. I am however having trouble creating a routine to stick an 'alpha' zero in front of the 6.25. I am not that worried about the decimal point being a colon but for formatting the output (neatness freak!) I would like a routine that converts:
6.25 into 06.25
or better yet
6.25 into 06:25 as the HP41CX "ATIME" function does.
ANY takers for the challenge, which I will be working on tonight!
Cheers, Geoff wanting a neat output!!!!!