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.
DM42 / Free42 state file compatibility
-
- Posts: 1102
- Joined: Tue May 02, 2017 5:48 pm
- Location: Netherlands
- Contact:
Re: DM42 / Free42 state file compatibility
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
(!!!!!!!! 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
-
- Posts: 1102
- Joined: Tue May 02, 2017 5:48 pm
- Location: Netherlands
- Contact:
Re: DM42 / Free42 state file compatibility
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.
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.
-
- Posts: 1102
- Joined: Tue May 02, 2017 5:48 pm
- Location: Netherlands
- Contact:
Re: DM42 / Free42 state file compatibility
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.
Re: DM42 / Free42 state file compatibility
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
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
-
- Posts: 1102
- Joined: Tue May 02, 2017 5:48 pm
- Location: Netherlands
- Contact:
-
- Posts: 1102
- Joined: Tue May 02, 2017 5:48 pm
- Location: Netherlands
- Contact:
Re: DM42 / Free42 state file compatibility
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!)
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!)
Re: DM42 / Free42 state file compatibility
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
Werner
41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE, DM15L
-
- Posts: 1102
- Joined: Tue May 02, 2017 5:48 pm
- Location: Netherlands
- Contact:
Re: DM42 / Free42 state file compatibility
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.
Re: DM42 / Free42 state file compatibility
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