JP1 Remotes Forum Index JP1 Remotes


FAQFAQ SearchSearch 7 days of topics7 Days MemberlistMemberlist UsergroupsUsergroups RegisterRegister
ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in

Corrupted .rmir files
Goto page Previous  1, 2
 
Post new topic   Reply to topic    JP1 Remotes Forum Index -> JP1 - Beginners
View previous topic :: View next topic  
Author Message
chileboy



Joined: 26 Aug 2020
Posts: 54
Location: NJ

PostPosted: Fri Sep 11, 2020 5:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
The Robman
Site Owner


Joined: 01 Aug 2003
Posts: 19813
Location: Chicago, IL

PostPosted: Fri Sep 11, 2020 6:16 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
mdavej
Expert


Joined: 08 Oct 2003
Posts: 4135

PostPosted: Fri Sep 11, 2020 6:27 pm    Post subject: Reply with quote

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
View user's profile Send private message
mdavej
Expert


Joined: 08 Oct 2003
Posts: 4135

PostPosted: Fri Sep 11, 2020 8:13 pm    Post subject: Reply with quote

Here's an image for a blank button:
http://www.hifi-remote.com/forums/dload.php?action=file&file_id=26080
Back to top
View user's profile Send private message
mathdon
Expert


Joined: 22 Jul 2008
Posts: 3582
Location: Cambridge, UK

PostPosted: Sat Sep 12, 2020 7:07 am    Post subject: Reply with quote

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
View user's profile Send private message
chileboy



Joined: 26 Aug 2020
Posts: 54
Location: NJ

PostPosted: Sun Sep 13, 2020 10:02 am    Post subject: Reply with quote

mdavej wrote:
Here's an image for a blank button:
http://www.hifi-remote.com/forums/dload.php?action=file&file_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?
_________________
- Mark
Back to top
View user's profile Send private message
mathdon
Expert


Joined: 22 Jul 2008
Posts: 3582
Location: Cambridge, UK

PostPosted: Mon Sep 14, 2020 6:25 am    Post subject: Reply with quote

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
View user's profile Send private message
chileboy



Joined: 26 Aug 2020
Posts: 54
Location: NJ

PostPosted: Mon Sep 14, 2020 5:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
chileboy



Joined: 26 Aug 2020
Posts: 54
Location: NJ

PostPosted: Mon Sep 14, 2020 6:50 pm    Post subject: Reply with quote

chileboy wrote:
mdavej wrote:
Here's an image for a blank button:
http://www.hifi-remote.com/forums/dload.php?action=file&file_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.
_________________
- Mark
Back to top
View user's profile Send private message
mdavej
Expert


Joined: 08 Oct 2003
Posts: 4135

PostPosted: Mon Sep 14, 2020 7:38 pm    Post subject: Reply with quote

That's great to hear.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic       JP1 Remotes Forum Index -> JP1 - Beginners All times are GMT - 5 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

Powered by phpBB © 2001, 2005 phpBB Group
Get Smart! the band's official homepage Rockabilly Central