|Day-Of-Week (DOW) in the HP48 series - challenge?|
Message #1 Posted by Vieira, Luiz C. (Brazil) on 18 Jan 2003, 11:03 p.m.
It's time for chalanges, and good challenges are teasing and their result is always helpfull.
I have an HP41CX and this was my first calcualtor with real time capabilities. Later I got an HP48SX, an HP48G+ and now an HP49G. Although the HP12C does not have a real-time clock, it can deal with date arithmetic, as all of the above.
The HP41CX (or its time module functions) has the DOW function, that returns the day-of-week reference for the date coded in the X-register. The HP12C also "shows" the day ofg week when a a date is computed.
Maybe many of you already needed this specific information any of the HP48 calcualtors and it is not available this "easy". The way I found was with the program below, that returns the DOW indicator for any date in Level 1 provided it's coded the same way we do in the HP12C or the HP41CX (or with the Time Module) and according to DMY or MDY set
« 0 TSTR 1 3 SUB »
I store it as 'DOW', and it returns a three letter string ID: "SUN", "MON" and so. The fact is that TSTR (Time STRing) does the trick.
Any other way to accomplish this? I'm not sure this is of any help, but as we do not have DOW directly availlable, it will allow others to focus in the problem and easily have this information without bigger routines.
Vieira, Luiz C.