Post Reply 
XSTR on Free42
07-10-2021, 07:49 AM
Post: #1
XSTR on Free42
hello,
I played around with the new XSTR command on free42.
I've seen it works wonderfully, for example:
- if you use it to put a 7 chars string in the X register than also indirect label instructions will work as expected (it seems like a little revolution);
- data are stored and recalled correctly in registers and variables
- also in matrices, so you can have an array of full length strings
- also ARCL in the alpha register works correctly...
and so on.

However I didn't figure out a way to recal the whole alpha register in the X register, as it would come from XSTR. The standard ASTO way, of course, will get just the first 6 characters.
Is there some way to get the right result?
Is needed a new instruction that will be available in future Free42 releases?
Thank you
Find all posts by this user
Quote this message in a reply
07-10-2021, 03:27 PM
Post: #2
RE: XSTR on Free42
(07-10-2021 07:49 AM)mtern Wrote:  However I didn't figure out a way to recal the whole alpha register in the X register, as it would come from XSTR. The standard ASTO way, of course, will get just the first 6 characters.
Is there some way to get the right result?
Is needed a new instruction that will be available in future Free42 releases?

To store the entire alpha register, you need the XASTO function, which is currently only in Plus42.
(I think I'll add the new string functions in Free42 as well, eventually, but for now there is only XSTR, which is needed to create custom error messages for RTNERR.)

The new string functions are described here, and the Plus42 test builds are here.
Visit this user's website Find all posts by this user
Quote this message in a reply
07-10-2021, 09:51 PM
Post: #3
RE: XSTR on Free42
(07-10-2021 03:27 PM)Thomas Okken Wrote:  The new string functions are described here, and the Plus42 test builds are here.

Thanks for the provision of using a signal file to allow it to be run in Windows as portable or side by side with Free42 installed. Is the signal file only "portable" or is "portable." also allowed? Depending on how you make it, the file might include the trailing ".".

FYI, some of the entries in the keyboard mapping table include non-ANSI ASCII characters, e.g. the first 2 entries.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
07-10-2021, 10:51 PM
Post: #4
RE: XSTR on Free42
(07-10-2021 09:51 PM)rprosperi Wrote:  Thanks for the provision of using a signal file to allow it to be run in Windows as portable or side by side with Free42 installed. Is the signal file only "portable" or is "portable." also allowed? Depending on how you make it, the file might include the trailing ".".

It has to be named "portable" (case insensitive) without the trailing dot. It looks like Windows Explorer won't let you create a file or directory named "portable." and removes the trailing dot if you try; when I create such a file or directory from the Cygwin bash shell, it isn't displayed in Explorer.

Free42 (or Plus42) looks for "portable" without trailing dot, and won't recognize the file if the name does include the trailing dot.

(07-10-2021 09:51 PM)rprosperi Wrote:  FYI, some of the entries in the keyboard mapping table include non-ANSI ASCII characters, e.g. the first 2 entries.

The key codes used in the Windows version's keymap.txt file are Windows Virtual Key Codes; see https://docs.microsoft.com/en-us/windows...-key-codes
Visit this user's website Find all posts by this user
Quote this message in a reply
07-11-2021, 02:36 AM
Post: #5
RE: XSTR on Free42
(07-10-2021 10:51 PM)Thomas Okken Wrote:  
(07-10-2021 09:51 PM)rprosperi Wrote:  Thanks for the provision of using a signal file to allow it to be run in Windows as portable or side by side with Free42 installed. Is the signal file only "portable" or is "portable." also allowed? Depending on how you make it, the file might include the trailing ".".

It has to be named "portable" (case insensitive) without the trailing dot. It looks like Windows Explorer won't let you create a file or directory named "portable." and removes the trailing dot if you try; when I create such a file or directory from the Cygwin bash shell, it isn't displayed in Explorer.

Free42 (or Plus42) looks for "portable" without trailing dot, and won't recognize the file if the name does include the trailing dot.

(07-10-2021 09:51 PM)rprosperi Wrote:  FYI, some of the entries in the keyboard mapping table include non-ANSI ASCII characters, e.g. the first 2 entries.

The key codes used in the Windows version's keymap.txt file are Windows Virtual Key Codes; see https://docs.microsoft.com/en-us/windows...-key-codes

Thanks. Some apps will create files with the trailing dot, and apps that expect these kinds of files usually work with one, but not the other, so just checking which is desired.

Sorry I wasn't clear - I opened the README.txt file and the text editor I used complained about the invalid characters in the table shown there.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
07-11-2021, 07:10 AM (This post was last modified: 07-11-2021 09:43 AM by Thomas Okken.)
Post: #6
RE: XSTR on Free42
(07-11-2021 02:36 AM)rprosperi Wrote:  Thanks. Some apps will create files with the trailing dot, and apps that expect these kinds of files usually work with one, but not the other, so just checking which is desired.

Well, it certainly isn't hard to make the app recognize "portable." in addition to "portable"... I'll add that check in the next update.

(07-11-2021 02:36 AM)rprosperi Wrote:  Sorry I wasn't clear - I opened the README.txt file and the text editor I used complained about the invalid characters in the table shown there.

Hmm, that's annoying. The README.txt file is UTF-8-encoded, which it needs to be because Windows-1252 doesn't provide all the symbols it needs. Once upon a time you'd make that explicit by adding a BOM at the start of the file, but those appear to have fallen out of favor in the Windows world, i.e. other text editors have started complaining about them. If there are still text editors that don't recognize UTF-8 by default, that's a problem, but I think it's the text editors in question that need to be fixed, not the standards-compliant UTF-8 text files they're complaining about...

(UPDATE: It looks like even Microsoft doesn't have its act together on this yet. Notepad in Windows 10 handles README.txt fine, and in fact appears to use UTF-8 without BOM as its default encoding, and Visual Studio 2019 has no problems, either. But Windows 10 WordPad garbles README.txt, even if you tell it the file is Unicode text while opening it.)
Visit this user's website Find all posts by this user
Quote this message in a reply
07-11-2021, 10:38 AM
Post: #7
RE: XSTR on Free42
(07-10-2021 03:27 PM)Thomas Okken Wrote:  To store the entire alpha register, you need the XASTO function, which is currently only in Plus42.
(I think I'll add the new string functions in Free42 as well, eventually, but for now there is only XSTR, which is needed to create custom error messages for RTNERR.)

The new string functions are described here, and the Plus42 test builds are here.

Thank you Thomas.
I think adding just XASTO would be enough to enable extended strings on free42, as it makes easy saving the alpha register in a local subroutine, then you can do string manipulation using the alpha functions.
Find all posts by this user
Quote this message in a reply
07-25-2021, 08:18 PM
Post: #8
RE: XSTR on Free42
I'm adding the whole set (all 16 functions under CATALOG -> STR in Plus42). They will be in the next Free42 update.
Visit this user's website Find all posts by this user
Quote this message in a reply
07-26-2021, 12:07 AM
Post: #9
RE: XSTR on Free42
Is there any planning on when Plus42 will be out of beta? I'm now running Plus42 3.0.5, which is apparently a beta version.

Quote:I'm adding the whole set (all 16 functions under CATALOG -> STR in Plus42). They will be in the next Free42 update.
You might be eating up Plus42 sales here with all the backporting...
Find all posts by this user
Quote this message in a reply
07-26-2021, 12:34 AM
Post: #10
RE: XSTR on Free42
(07-26-2021 12:07 AM)johanw Wrote:  Is there any planning on when Plus42 will be out of beta? I'm now running Plus42 3.0.5, which is apparently a beta version.

Late summer or early autumn, I hope.

(07-26-2021 12:07 AM)johanw Wrote:  
Quote:I'm adding the whole set (all 16 functions under CATALOG -> STR in Plus42). They will be in the next Free42 update.

You might be eating up Plus42 sales here with all the backporting...

I think Plus42 will still have enough to make it compelling. Smile
Visit this user's website Find all posts by this user
Quote this message in a reply
07-30-2021, 07:57 PM
Post: #11
RE: XSTR on Free42
(07-25-2021 08:18 PM)Thomas Okken Wrote:  I'm adding the whole set (all 16 functions under CATALOG -> STR in Plus42). They will be in the next Free42 update.

Great Thomas, very good!

I've seen today the new functions.

Thank you for your work and your generosity.



Mark
Find all posts by this user
Quote this message in a reply
Post Reply 




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