The Museum of HP Calculators

HP Forum Archive 09

[ Return to Index | Top of Index ]

visualizzazione risultati di un programma nel hp49G
Message #1 Posted by dennis on 6 Oct 2002, 8:40 a.m.

Salve a tutti, posseggo una calcolatrice HP 49 G e ho un problema che non riesco a risolvere: vorrei creare un programma che faccia la somma e la sottrazione di due numeri. Al dilà della semplicità dell'operazione da eseguire, vorrei porre però l'attenzione al modo di visualizzazione.

Vorrei che una volta lanciato il programma, la calcolatrice mi chieda il valore di a, poi quello di b ed infine mi restituisca c= il valore della somma, d= valore della sottrazione. Riesco a scrivere il programma, però non riesco a fare in modo che i risultati compaiano entrambi sullo schermo, perchè la calcolatrice visualizza solo l'ultima riga (in questo caso il valore della sottrazione). Come devo fare?

In pratica alla fine dell'esecuzione del programma vorrei vedere questo:

----------------------- dammi a: 5 dammi b: 2

la somma è: 7 la sottrazione è: 3 -----------------------

Molte grazie a chi potrà spiegarmi come devo scrivere il programma. Così facendo potrò scriverne altri più complessi con la stessa procedura

Dennis

      
Re: visualizzazione risultati di un programma nel hp49G
Message #2 Posted by Vieira, Luiz C. (Brazil) on 6 Oct 2002, 11:34 a.m.,
in response to message #1 by dennis

Hi;

one possible solution is:

« "Input a:" "" INPUT
"Input b:" "" INPUT
-> a b «
"a = " a + " (place a line-feed here)
b = " b + + " (place a line-feed here)
c = " a b + + + " (place a line-feed here)
d = " a b - + +
CLLCD 1 DISP 3 FREEZE » » 
You can change the input strigns as you wish, like this:
« "dammi a:" "" INPUT
"dammi b:" "" INPUT
-> a b «
"a = " a + "
b = " b + + "
la somma è: " a b + + + "
la sottrazzione è: " a b - + +
CLLCD 1 DISP 3 FREEZE » » 
Note that: -> is the representation of one only character, a righ-arrow, and when you see (place a line-feed here) you should add the line-feed character, a turn-to-left arrow.

Success.

(I did not test the program be cause I'm in a hurry; if it does not work, post a warning and I'll check for it; thank you)

            
Re: visualizzazione risultati à la hp49G: correction
Message #3 Posted by Vieira, Luiz C. (Brazil) on 6 Oct 2002, 6:49 p.m.,
in response to message #2 by Vieira, Luiz C. (Brazil)

Hi;

I was in a hurry and I forgot to add OBJ-> after INPUT, so the input data can be used as a mnumber. The corrected program is:

« "Input a:" "" INPUT OBJ->
"Input b:" "" INPUT OBJ->
-> a b «
"a = " a + " (place a line-feed here)
b = " b + + " (place a line-feed here)
c = " a b + + + " (place a line-feed here)
d = " a b - + +
CLLCD 1 DISP 3 FREEZE » » 
Sorry if I did not see this first.

Best regards.

                  
problema
Message #4 Posted by dennis on 8 Oct 2002, 8:06 a.m.,
in response to message #3 by Vieira, Luiz C. (Brazil)

Ciao Vieira, Luiz C., grazie per aver risposto: ieri ho provato il programma, ma va in errore alla riga:

"a = a + "

Non sono pratico con la notazione inversa polacca. Sapresti dirmi come dovrei scriverlo con la notazione "algebraic"?

Grazie mille per l'aiuto, se riesco a risolvere questo problema potrò fare dei programmi più utili.

Dennis

                        
Re: problema
Message #5 Posted by Vieira, Luiz C. (Brazil) on 8 Oct 2002, 12:33 p.m.,
in response to message #4 by dennis

Hello, Dennis;

Forgive-me if I do not answer you in Italian; as I speak Portuguese, it's not hard to understand the basic of your message, but I have to use a translator for understanding it completely.

About the line you pointed as troubled, I would ask you, please, to check for correct spelling, that is:

"a = " a + 
instead of
"a = a + "
(please, note the ["] character actual position).

I'm sending to your e-mail (today later) a file that you can directly download to your HP49G. I believe it will work fine.

About the algebraic version: would you mind waiting for a bit more, say, tomorrow? I'm gonna have to read some parts of the HP49G's manual to accomplish this request, but there is no trouble at all; I was waiting for a good chance to delve into the HP49's algebraic capabilities.

Thank you and best regards.

                        
Re: program listing: a better viewing
Message #6 Posted by Vieira, Luiz C. (Brazil) on 8 Oct 2002, 12:59 p.m.,
in response to message #4 by dennis

This is a better viewing of the program:

«
"Input a:"
""
INPUT
OBJ->
"Input b:"
""
INPUT
OBJ->
-> a b «
"a = "
a +
"(place a line-feed here)b = "
b +
+
"(place a line-feed here)c = "
a b +
+
+
"(place a line-feed here)d = "
a b -
+
+
CLLCD
1 DISP
3 FREEZE
»
»

This way of listing the program will probably allow you to "see" it in a more functional structure.

Best regards.

                              
thank you
Message #7 Posted by dennis on 9 Oct 2002, 9:24 a.m.,
in response to message #6 by Vieira, Luiz C. (Brazil)

Ciao, Vieira, Luiz C., grazie per avermi risposto. Il programma che hai scritto funziona benissimo, e con un po di sforzo l'ho riscritto in linguaggio "algebraic". Ora posso finalmente risolvere delle lunghe espressioni per il clacolo di elementi strutturali in calcestruzzo armato.

Cordiali Saluti Dennis


[ Return to Index | Top of Index ]

Go back to the main exhibit hall