Post Reply 
Print TIME and DATE
12-29-2019, 07:27 PM
Post: #1
Print TIME and DATE
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
Find all posts by this user
Quote this message in a reply
12-30-2019, 06:05 PM
Post: #2
RE: Print TIME and DATE
(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

Dave - My mind is going - I can feel it.
Find all posts by this user
Quote this message in a reply
12-31-2019, 02:41 PM
Post: #3
RE: Print TIME and DATE
Nice....
I tried but...


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


Could you answer me?
Find all posts by this user
Quote this message in a reply
12-31-2019, 03:03 PM (This post was last modified: 12-31-2019 03:06 PM by twoweims.)
Post: #4
RE: Print TIME and DATE
It is the "APPEND" Symbol

ALPHA - SHIFT - K

Followed by a Space.
Visit this user's website Find all posts by this user
Quote this message in a reply
12-31-2019, 03:08 PM
Post: #5
RE: Print TIME and DATE
ok. Thanks a lot!

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

NAME?
PROMPT
DINAMARCO
Find all posts by this user
Quote this message in a reply
12-31-2019, 05:52 PM (This post was last modified: 12-31-2019 05:57 PM by Jeff O..)
Post: #6
RE: Print TIME and DATE
(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

Dave - My mind is going - I can feel it.
Find all posts by this user
Quote this message in a reply
12-31-2019, 07:42 PM
Post: #7
RE: Print TIME and DATE
Thanks DAVE...
I wrote it in my small program.

Best Regards...
Find all posts by this user
Quote this message in a reply
12-31-2019, 07:59 PM (This post was last modified: 12-31-2019 08:04 PM by Sylvain Cote.)
Post: #8
RE: Print TIME and DATE
(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
Find all posts by this user
Quote this message in a reply
12-31-2019, 09:50 PM
Post: #9
RE: Print TIME and DATE
Solved!!!

Thanks a lot for everyone who help me!

Happy new year!!!
Find all posts by this user
Quote this message in a reply
01-01-2020, 03:25 PM
Post: #10
RE: Print TIME and DATE
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.
Find all posts by this user
Quote this message in a reply
01-01-2020, 04:54 PM
Post: #11
RE: Print TIME and DATE
(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
Find all posts by this user
Quote this message in a reply
01-01-2020, 05:49 PM
Post: #12
RE: Print TIME and DATE
Nice...
I'm able to translate to Portuguese

Regards.
Nice 2020!
Find all posts by this user
Quote this message in a reply
01-01-2020, 08:31 PM
Post: #13
HP 2225 head
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
Find all posts by this user
Quote this message in a reply
01-01-2020, 08:56 PM
Post: #14
RE: Print TIME and DATE
Indeed, I'm interested...
[PM sent]

André
Find all posts by this user
Quote this message in a reply
01-01-2020, 09:04 PM
Post: #15
RE: Print TIME and DATE
(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
Find all posts by this user
Quote this message in a reply
01-01-2020, 09:26 PM
Post: #16
RE: Print TIME and DATE
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
Find all posts by this user
Quote this message in a reply
Post Reply 




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