HP Forums
Print TIME and DATE - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: Print TIME and DATE (/thread-14262.html)



Print TIME and DATE - Dinamarco - 12-29-2019 07:27 PM

Could you help me?
I have a HP41CX

When I'm using some HP-IL printer, like HP2225C, I'd like to print the TIME and DATE in first line.

Thanks for help me


RE: Print TIME and DATE - Jeff O. - 12-30-2019 06:05 PM

(12-29-2019 07:27 PM)Dinamarco Wrote:  Could you help me?
I have a HP41CX

When I'm using some HP-IL printer, like HP2225C, I'd like to print the TIME and DATE in first line.

Thanks for help me

This is probably clunky, but seems to work:
CLA
TIME
ATIME
|-" "
DATE
ADATE
PRA


RE: Print TIME and DATE - Dinamarco - 12-31-2019 02:41 PM

Nice....
I tried but...


CLA
TIME
ATIME
|-" " (how do I type it in HP41cx ?)
DATE
ADATE
PRA


Could you answer me?


RE: Print TIME and DATE - twoweims - 12-31-2019 03:03 PM

It is the "APPEND" Symbol

ALPHA - SHIFT - K

Followed by a Space.


RE: Print TIME and DATE - Dinamarco - 12-31-2019 03:08 PM

ok. Thanks a lot!

Another simple question: Is possible to print an simple text after a question, for example:

NAME?
PROMPT
DINAMARCO


RE: Print TIME and DATE - Jeff O. - 12-31-2019 05:52 PM

(12-31-2019 02:41 PM)Dinamarco Wrote:  ...
I tried but...
Could you answer me?

Sorry I did not see your question sooner, I should have realized that the APPEND function might not be obvious. Thanks to twoweims for answering.

I also realized my code could use some more work. The ATIME and ADATE functions observe or obey the current display mode to some exent, so some FIX commands would be needed to insure a pleasing output. Something like the below gives good results:

CLA
FIX 02
TIME
ATIME
|-" "
DATE
FIX 04
ADATE
PRA

Above provides hours and minutes for the time, for example, if I execute it at this very moment, I get:
12:40 PM 12/31/19

If hours minutes and seconds are preferred, just put a FIX 04 at the beginning and get:
12:40:15 PM 12/31/19

If DMY is preferred:
12:40 PM 31.12.19

If 24 hour time is prefrerred:
12:40 31.12.19

If you want the whole year, replace the FIX 04 with a FIX 06:
12:40 PM 12/31/2019


RE: Print TIME and DATE - Dinamarco - 12-31-2019 07:42 PM

Thanks DAVE...
I wrote it in my small program.

Best Regards...


RE: Print TIME and DATE - Sylvain Cote - 12-31-2019 07:59 PM

(12-31-2019 03:08 PM)Dinamarco Wrote:  Another simple question: Is possible to print an simple text after a question, for example:

NAME?
PROMPT
DINAMARCO

On the LCD no (well, yes but not really), on the printer yes.
Code:
LBL "TEST"         // test program
AON                // ALPHA ON
"NAME ? "          // question
ACA                // add ALPHA content (question) to printer buffer, no CR+LF added
PROMPT             // show question on the LCD, wait for user to enter his name and then press R/S to restart the program
AOFF               // ALPHA OFF
PRA                // add alpha content (user name) to printer buffer, add CR+LF and print buffer
END                // end of program

Printer output:
Code:
NAME ? SYLVAIN



RE: Print TIME and DATE - Dinamarco - 12-31-2019 09:50 PM

Solved!!!

Thanks a lot for everyone who help me!

Happy new year!!!


RE: Print TIME and DATE - dayd - 01-01-2020 03:25 PM

Happy new year every one!
Late and probably a bit outside the scope but here's a few line of code I use to display the date in french.

Code:

01◆LBL "JOUR"
 02 DATE
 03◆LBL D
 04 DOW
 05 XEQ IND X
 06 "|- "
 07 RCL d
 08 FIX 2
 09 SF 28
 10 ARCL L
 11 STO d
 12 AVIEW
 13 CLX
 14 LASTX
 15 RTN
 16◆LBL 00
 17 "DIMANCH."
 18 RTN
 19◆LBL 01
 20 "LUNDI"
 21 RTN
 22◆LBL 02
 23 "MARDI"
 24 RTN
 25◆LBL 03
 26 "MERCRED."
 27 RTN
 28◆LBL 04
 29 "JEUDI"
 30 RTN
 31◆LBL 05
 32 "VENDRED."
 33 RTN
 34◆LBL 06
 35 "SAMEDI"
 36 END

Once the pointer in the program, 03 LBL D is there to display any given date in X.
Line 06 is Append Space.
Lines 07 & 11 are synthetic instructions to keep the previous status (flags) of the 41, they can be omitted.

Also this nice to see that there's still HP2225C printers out there. Mine is out of order cause the cartridge wasn't removed by the previous owner.


RE: Print TIME and DATE - Sylvain Cote - 01-01-2020 04:54 PM

(01-01-2020 03:25 PM)dayd Wrote:  Late and probably a bit outside the scope but here's a few line of code I use to display the date in french.

Alternative implementation using X<>F instead of XEQ IND X.

DOW converted into flags with X<>F
Code:
000 : DIM / SUN
001 : LUN / MON
010 : MAR / TUE
011 : MER / WED
100 : JEU / THU
101 : VEN / FRI
110 : SAM / SAT
111 : not used

Program listing: (based on yours)
Code:
LBL "JOUR"
DATE
LBL D
DOW
X<>F
FC? 02
GTO 00
"JEU"
FS? 01
"SAM"
FS? 00
"VEN"
GTO 01
LBL 00
FC? 01
GTO 00
"MAR"
FS? 00
"MER"
GTO 01
LBL 00
"DIM"
FS? 00
"LUN"
LBL 01
X<>F
"|- "
RCL d
FIX 2
SF 28
ARCL L
STO d
AVIEW
CLX
LASTX
RTN



RE: Print TIME and DATE - Dinamarco - 01-01-2020 05:49 PM

Nice...
I'm able to translate to Portuguese

Regards.
Nice 2020!


HP 2225 head - Dinamarco - 01-01-2020 08:31 PM

Also this nice to see that there's still HP2225C printers out there. Mine is out of order cause the cartridge wasn't removed by the previous owner.


I'm able to send you another "head" from HP2225.
If you want it, let me know.
you gonna pay only the Shipping.

Best regards.
Thanks again for your help


RE: Print TIME and DATE - dayd - 01-01-2020 08:56 PM

Indeed, I'm interested...
[PM sent]

André


RE: Print TIME and DATE - Dinamarco - 01-01-2020 09:04 PM

(01-01-2020 08:56 PM)dayd Wrote:  Indeed, I'm interested...
[PM sent]

André


Do you speak Portuguese or English?
send me a private message with your address.
Let you know the shipping cost.

I'm not sure the part will work, but,,, let's try.

Regards

Nelson Dinamarco


RE: Print TIME and DATE - dayd - 01-01-2020 09:26 PM

Quote:Do you speak Portuguese or English?
Both (in a limited way), and french of course.
Quote:send me a private message with your address.
Let you know the shipping cost.

I'm not sure the part will work, but,,, let's try.
Very nice! Would love to see it working.
Thanks a lot

[re-PM]

Quote:Alternative implementation using X<>F instead of XEQ IND X.

Always cool to see others way of writing code