Page 2 of 2

Posted: Fri Sep 11, 2020 4:24 pm
by chileboy
mathdon wrote:I have found the source of the problem. In your Anthem device upgrade you have a function whose name is \, the backslash character. That character has special meaning in Java strings, it is the escape character and using it as a function name on its own caused RMIR to crash.
I figured out this is because of the "trick" I was using to create empty spots on the soft key pages by using a space as a function name, as discussed in this thread. When the .rmir is saved, "name= " is replaced by "name=". From my cursory parsing of the file, RMIR appears by design to prepend the backslant to any non-alphabetic (i.e., A-Z, 0-9) character - for instance,I have an activity named "Good Night!" and in the .rmir it appears as "Good Night\!" - which I assume works fine because the backslash doesn't appear in isolation.

Posted: Fri Sep 11, 2020 5:16 pm
by The Robman
Maybe an underscore (_) would be a better "space" character

Posted: Fri Sep 11, 2020 5:27 pm
by mdavej
Here's something that just occurred to me. You could use a graphic that looks like an empty button. That way you can give your spacer function a name like "Blank" or "Null", then assign the graphic to it. I'll post a custom png file for a blank button a little later.

Posted: Fri Sep 11, 2020 7:13 pm
by mdavej
Here's an image for a blank button:
http://www.hifi-remote.com/forums/dload ... e_id=26080

Posted: Sat Sep 12, 2020 6:07 am
by mathdon
chileboy wrote:I figured out this is because of the "trick" I was using to create empty spots on the soft key pages by using a space as a function name, as discussed in this thread. When the .rmir is saved, "name= " is replaced by "name=". From my cursory parsing of the file, RMIR appears by design to prepend the backslant to any non-alphabetic (i.e., A-Z, 0-9) character
I had already amended RMIR so that it would not crash when the name was a backslash (the build with this fix has not yet been posted, so you haven't missed it) ,but now I know what was intended, I have fixed it properly so that your original file now loads and shows the name of the function concerned correctly as a space. I hope to post that build shortly.

If you are interested, here is what was happening. Certain non-alphabetic characters (not all, but those that can have special significance) are prefixed by a backslash as escape character when written in a function name in a .rmir file. These include the space character, so what is actually written is backslash followed by space. But when that line in the file is read back, trailing spaces are trimmed so leaving only the backslash, which was causing the crash. I have now made a final backslash be interpreted as a space, as it can only have been produced by trimming the backslash space combination.

Posted: Sun Sep 13, 2020 9:02 am
by chileboy
mdavej wrote:Here's an image for a blank button:
http://www.hifi-remote.com/forums/dload ... e_id=26080
That's more elegant than my solution, which was using ASCII 255 instead of a space. I don't have my replacement Xsight yet but I'm going to use your icon - thank you!
mathdon wrote:If you are interested, here is what was happening. Certain non-alphabetic characters (not all, but those that can have special significance) are prefixed by a backslash as escape character when written in a function name in a .rmir file. These include the space character, so what is actually written is backslash followed by space. But when that line in the file is read back, trailing spaces are trimmed so leaving only the backslash, which was causing the crash. I have now made a final backslash be interpreted as a space, as it can only have been produced by trimming the backslash space combination.
I've done a bit of programming, so I figured it was something like that. Purely out of curiosity I was going to try using a double-backslash to see if the .rmir would load properly, and the actual name then appeared as a (single) backslash.

So a trailing space in a name would now be left intact?

Posted: Mon Sep 14, 2020 5:25 am
by mathdon
chileboy wrote:So a trailing space in a name would now be left intact?
Yes (in the next release, which is imminent). Indeed, any number of trailing spaces would be preserved.

Posted: Mon Sep 14, 2020 4:46 pm
by chileboy
mathdon wrote:
chileboy wrote:So a trailing space in a name would now be left intact?
Yes (in the next release, which is imminent). Indeed, any number of trailing spaces would be preserved.
Ok. Just curious. Trying to think of some practical use.

Posted: Mon Sep 14, 2020 5:50 pm
by chileboy
chileboy wrote:
mdavej wrote:Here's an image for a blank button:
http://www.hifi-remote.com/forums/dload ... e_id=26080
That's more elegant than my solution, which was using ASCII 255 instead of a space. I don't have my replacement Xsight yet but I'm going to use your icon - thank you!
Received the replacement Xsight today, this works perfectly - thanks again.

Posted: Mon Sep 14, 2020 6:38 pm
by mdavej
That's great to hear.