View previous topic :: View next topic |
Author |
Message |
chileboy
Joined: 26 Aug 2020 Posts: 83 Location: NJ |
Posted: Fri Sep 11, 2020 5:24 pm Post subject: |
|
|
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. _________________ - Mark |
|
Back to top |
|
|
The Robman Site Owner
Joined: 01 Aug 2003 Posts: 21271 Location: Chicago, IL |
Posted: Fri Sep 11, 2020 6:16 pm Post subject: |
|
|
Maybe an underscore (_) would be a better "space" character _________________ Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help! |
|
Back to top |
|
|
mdavej Expert
Joined: 08 Oct 2003 Posts: 4519
|
Posted: Fri Sep 11, 2020 6:27 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
mdavej Expert
Joined: 08 Oct 2003 Posts: 4519
|
|
Back to top |
|
|
mathdon Expert
Joined: 22 Jul 2008 Posts: 4530 Location: Cambridge, UK |
Posted: Sat Sep 12, 2020 7:07 am Post subject: |
|
|
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. _________________ Graham |
|
Back to top |
|
|
chileboy
Joined: 26 Aug 2020 Posts: 83 Location: NJ |
Posted: Sun Sep 13, 2020 10:02 am Post subject: |
|
|
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? _________________ - Mark |
|
Back to top |
|
|
mathdon Expert
Joined: 22 Jul 2008 Posts: 4530 Location: Cambridge, UK |
Posted: Mon Sep 14, 2020 6:25 am Post subject: |
|
|
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. _________________ Graham |
|
Back to top |
|
|
chileboy
Joined: 26 Aug 2020 Posts: 83 Location: NJ |
Posted: Mon Sep 14, 2020 5:46 pm Post subject: |
|
|
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. _________________ - Mark |
|
Back to top |
|
|
chileboy
Joined: 26 Aug 2020 Posts: 83 Location: NJ |
Posted: Mon Sep 14, 2020 6:50 pm Post subject: |
|
|
chileboy wrote: |
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. _________________ - Mark |
|
Back to top |
|
|
mdavej Expert
Joined: 08 Oct 2003 Posts: 4519
|
Posted: Mon Sep 14, 2020 7:38 pm Post subject: |
|
|
That's great to hear. |
|
Back to top |
|
|
|