Does anyone have good routines for setting up a DS1302 RTC with a numeric keypad?

Hello Everyone
Just trying to save myself a little programming, and I was wondering if anyone had a good set of functions for setting the month, day, year, weekday, hours, minutes, and seconds, of the DS1302 RTC, with a 16 key numeric keypad. If you have any handy, I would appreciate being able to look at them and possibly use them.
Thanks In Advance
Bruce
Just trying to save myself a little programming, and I was wondering if anyone had a good set of functions for setting the month, day, year, weekday, hours, minutes, and seconds, of the DS1302 RTC, with a 16 key numeric keypad. If you have any handy, I would appreciate being able to look at them and possibly use them.

Thanks In Advance
Bruce
Comments
This is not exactly what you asked for, but you might take a look at this to see if it is of any use to you:
http://obex.parallax.com/objects/696/
I'm working on a demo example of this approach for the ds1302_full object, but haven't finished debugging it yet.
I currently have the buttons and the DS1302, it is all wired up and ready to go. All I have to do is program it.
Bruce
pub getdec(digits) | dcount, c result := 0 ' clear result dcount := 0 ' clear digits count repeat c := kbd.waitkey ' wait for key input case c 0..9: if (dcount < digits) result := result * 10 + c ' add digit ++dcount ' update count else ' error beep 10: ' backspace/clear if (dcount > 0) result /= 10 ' remove last key --dcount ' update count else ' error beep 13: quit ' done other: ' error beep
As you know from another post you need to provide BCD values to the DS1302 (and most other RTCs). That's simple:
pub dec2bcd(dec) dec := 0 #> dec <# 99 ' for to legal range (0 to 99) return ((dec / 10) << 4) | (dec // 10) ' convert to BCD
Finally, in your practical code you might do something like this:
minsreg := dec2bcd(getdec(2))
It is my opinion that this style of code not only serves you, but those you hope to share it with because the input routines can be used in many applications as-is.