Post Reply 
How HP48 ASCII headers are supposed to work
09-06-2024, 07:00 PM
Post: #1
How HP48 ASCII headers are supposed to work
I'm kinda of a noob trying to understand some UserRPL bugs in order to fix them.

The bug in question happens in a program that stores equations as strings to later retrieve them.

The header used in the original program is :
Code:
%%HP: T(3)A(R)F(.);

The bug happens when evaluating an equation with arguments in a calculator set with
Code:
F(,)

Consider this program:

Code:

%%HP: T(3)A(R)F(.);
\<<
'\.S(-1, 1, x, x)'
\>>

If I transfer it to the calculator, I get a STR\-> Error because the argument separator doesn't match the expected ";".

However, if I manually type the program in the calculator and leave it in the stack, the argument separator correctly changes when the fraction mark changes (FLG 51):

   
   

   
   

As I understand, the calculator correctly changes the argument separator for program object types but not for strings, which is how programs are transferred to the calculator.

So what I want to know is: isn't that the whole point of the header ? Shouldn't it tell the calculator how to parse the incoming program in string form ? Otherwise, what's the point of it ?

Sorry for the long post and thank you in advance to anyone who can shed a light on this.
Find all posts by this user
Quote this message in a reply
09-06-2024, 11:29 PM
Post: #2
RE: How HP48 ASCII headers are supposed to work
I'm not quite sure what you're asking.

The header is for programs transferred into the calc and the translation is made as the program is received. Typing in a program with the wrong argument separator, for example, is just a typing error as far as the calc is concerned.
Find all posts by this user
Quote this message in a reply
09-07-2024, 05:00 AM
Post: #3
RE: How HP48 ASCII headers are supposed to work
Hi Bruce,

What I'm asking is how is the header used by the calculator (if at all). I thought it was a "how to parse this program" kind of information, but from my experiments it doesn't seem to work that way.
Find all posts by this user
Quote this message in a reply
09-08-2024, 12:26 AM
Post: #4
RE: How HP48 ASCII headers are supposed to work
(09-07-2024 05:00 AM)vcolella Wrote:  Hi Bruce,

What I'm asking is how is the header used by the calculator (if at all). I thought it was a "how to parse this program" kind of information, but from my experiments it doesn't seem to work that way.

It is only used by the calculator if the header is at the top of an ASCII program listing in a plain-text file on a computer, AND if that file is imported into the calculator via I/O (wire or IR) in ASCII mode. That "header" should never be keyed into the calculator directly. The calculator's command line doesn't use it. I hope that made sense!

<0|ΙΈ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
09-08-2024, 11:56 PM
Post: #5
RE: How HP48 ASCII headers are supposed to work
(09-08-2024 12:26 AM)Joe Horn Wrote:  
(09-07-2024 05:00 AM)vcolella Wrote:  Hi Bruce,

What I'm asking is how is the header used by the calculator (if at all). I thought it was a "how to parse this program" kind of information, but from my experiments it doesn't seem to work that way.

It is only used by the calculator if the header is at the top of an ASCII program listing in a plain-text file on a computer, AND if that file is imported into the calculator via I/O (wire or IR) in ASCII mode. That "header" should never be keyed into the calculator directly. The calculator's command line doesn't use it. I hope that made sense!

I guess it does make sense. I'm testing my programs through HPUserEdit and now that I'm thinking, its "send" function probably just inserts the whole program in the stack as a string to then call STR\-> on it.

I'll try to transfer some programs via serial to check if there's any difference, thanks !
Find all posts by this user
Quote this message in a reply
Post Reply 




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