DM42 / Free42 state file compatibility

Discussion around the SwissMicros DM42 calculator
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: DM42 / Free42 state file compatibility

Post by Thomas Okken »

Hmm, I see...

Would it be an option to use XSTR instead? There are no such limitations there. You can create those by using ASTO ST X or XASTO ST X followed by X2LINE.

Or I could modify A2LINE so that it recognizes strings starting with a character in the range 0x80-0xff and then generates CLA |-"ABC" instead of "ABC". Actually, that should also apply for strings starting with the append character.

BTW I made a note to allow +"ABC" for append lines while parsing program listings. That's a pretty common convention, I'm actually surprised that it's not supported already, looks like an oversight.
whuyse
Posts: 198
Joined: Thu Dec 21, 2017 1:23 pm

Re: DM42 / Free42 state file compatibility

Post by whuyse »

XSTR, yes. Once it finds its way into the DM42 ;-)
(!!!!!!!! it is there! I thought it was only in the latest release, along with all the other string functions. Yes, that's what I'm going to use, thanks! Even if I will have to do it all on the DM42 instead of the decoder)
Thanks for considering the +" " !
Cheers, Werner
41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE, DM15L
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: DM42 / Free42 state file compatibility

Post by Thomas Okken »

I made the A2LINE change and the +"ABC" change. They will be in the next Free42 release.

But yes, XSTR is in the DM42, and if that does the job for you as well, all the better! They didn't include the new string and list functions from 3.0.6, but XSTR was introduced earlier, in 3.0.3, so it did find its way into the latest firmware.
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: DM42 / Free42 state file compatibility

Post by Thomas Okken »

I'm also adding A2+LINE, for creating append lines.

Code: Select all

"ABC"  A2LINE  => "ABC"
"ABC"  A2+LINE => ├"ABC"
"├ABC" A2LINE  => CLA ├"├ABC"
"├ABC" A2+LINE => ├"├ABC"
"▒ABC" A2LINE  => CLA ├"▒ABC"
"▒ABC" A2+LINE => ├"▒ABC"
Last edited by Thomas Okken on Thu Nov 04, 2021 12:46 pm, edited 1 time in total.
whuyse
Posts: 198
Joined: Thu Dec 21, 2017 1:23 pm

Re: DM42 / Free42 state file compatibility

Post by whuyse »

Question: it's only the first text character that determines whether it's a string or an alpha command, right?
So if I have a string with a first character < 128, but possible larger codes further down, that will always be recognized as a string?
Werner
41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE, DM15L
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: DM42 / Free42 state file compatibility

Post by Thomas Okken »

whuyse wrote:
Thu Nov 04, 2021 12:38 pm
Question: it's only the first text character that determines whether it's a string or an alpha command, right?
So if I have a string with a first character < 128, but possible larger codes further down, that will always be recognized as a string?
Yes.
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: DM42 / Free42 state file compatibility

Post by Thomas Okken »

One catch when using such A2LINE- and X2LINE-generated string lines is that such programs won't, in general, be able to be shared as program listings, because the conversion from raw bytes to Unicode text loses some information.

The conversion was always a bit lossy, because of how it handles LF and ESC, and because character codes 4 and 30, which look the same on the calculator, are both translated to the same Unicode character, ▒. But with A2LINE and X2LINE, you're no longer limited to characters that are available in the ALPHA menu, so now there's the whole range 130-255 available to cause problems, looking exactly like their counterparts in the lower half of the character set.

(Sharing in raw format does work!)
whuyse
Posts: 198
Joined: Thu Dec 21, 2017 1:23 pm

Re: DM42 / Free42 state file compatibility

Post by whuyse »

Too bad HEXM is a setting that is only used within the BASE application - setting 'hex mode' could otherwise be used to show XSTR entries as hex codes, and export a program in readable format.
Werner
41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE, DM15L
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: DM42 / Free42 state file compatibility

Post by Thomas Okken »

Or how about a backward-compatible escape notation for problematic characters in strings. Say, €42 for 0x42. The escape character would have to be something that isn't in the HP-42S character set, but easy to recognize, and not so exotic that people wouldn't be able to type it on a standard keyboard.
whuyse
Posts: 198
Joined: Thu Dec 21, 2017 1:23 pm

Re: DM42 / Free42 state file compatibility

Post by whuyse »

Do all keyboards have the € symbol? Can't say, as here (in the EU in general) it is normal for all keyboard varieties to have it. I also wouldn't know of any other character that is not on the 42 yet on all keyboards.
41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE, DM15L
Post Reply