Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 05-27-2020, 06:41 AM   #1
cohler
Human being with feelings
 
Join Date: Dec 2018
Posts: 240
Default REAPER 6.11 numbers reaper-menu.ini file incorrectly

As of 6.11 the reaper-menu.ini file is being sorted incorrectly.

The item_nnn identifier at the beginning of each line is being sorted by alpha instead of by number. While internally in REAPER it still works, this causes problems for anyone who has written software that expects the reaper-menu.ini file to be ordered the way it has always been ordered.

So instead of sorting 0,1,2,3,4 ... it sorts 0,1,10,11,12,...

__________________
Source-Destination 4-Point Editing for REAPER!
Available NOW for PC & Mac • FREE Trial License included
info@cohlerclassical.comhttps://cohlerclassical.com
cohler is offline   Reply With Quote
Old 05-27-2020, 09:01 AM   #2
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 658
Default

One shouldn't rely on a specific order of entries in a "classical" ini file.
Best way would be to read the file and order it in your script/program by yourself so you can be sure to have full control over the read data and its ordering.

This counts for all ini-files in Reaper, which can be unordered by the user by hand as well, not only by Reaper itself.
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-27-2020, 09:28 AM   #3
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 10,955
Default

MAM is correct, you shouldn't rely on any sorting in ini files, but thank you for pointing out that this changed, because it was unintentional. We'll restore the behavior for the next release.
schwa is offline   Reply With Quote
Old 05-27-2020, 10:37 AM   #4
cohler
Human being with feelings
 
Join Date: Dec 2018
Posts: 240
Default

Quote:
Originally Posted by schwa View Post
MAM is correct, you shouldn't rely on any sorting in ini files, but thank you for pointing out that this changed, because it was unintentional. We'll restore the behavior for the next release.
I wasn’t relying on any particular order. I was relying on the ONLY order that has ever existed for the file. Indeed it is the definition of the file. And the only order.

Clearly a bug. Thank you for fixing the bug.
__________________
Source-Destination 4-Point Editing for REAPER!
Available NOW for PC & Mac • FREE Trial License included
info@cohlerclassical.comhttps://cohlerclassical.com
cohler is offline   Reply With Quote
Old 05-27-2020, 11:06 AM   #5
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 658
Default

There is no such ONLY order. It just happened to be one used by Reaper but still, you shouldn't rely on it as ini files aren't designed as such.

So it's not a bug, it's how inifiles of that design work in any app who use them and you need to take care of that.

It would be a bug, if the file wouldn't work but it does.
It's just not your preferred order.

Keep in mind that Reaperusers may edit the file by hand, distorting the ONLY order. Your code needs to take care of these things as it's not uncommon in the Reapercommunity.
So make your code accept the file in any order to be safe of any possible circumstance that could occur. This makes your code rocksolid and saves you from doong edgecase-debugsessions.

Have you looked into using the SWS-functions who access ini-files? They may help you getting over potential order problems.
Just look for functions with ProfileString in their names.
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-27-2020, 11:16 AM   #6
cohler
Human being with feelings
 
Join Date: Dec 2018
Posts: 240
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
There is no such ONLY order. It just happened to be one used by Reaper but still, you shouldn't rely on it as ini files aren't designed as such.

So it's not a bug, it's how inifiles of that design work in any app who use them and you need to take care of that.

It would be a bug, if the file wouldn't work but it does.
It's just not your preferred order.

Keep in mind that Reaperusers may edit the file by hand, distorting the ONLY order. Your code needs to take care of these things as it's not uncommon in the Reapercommunity.
So make your code accept the file in any order to be safe of any possible circumstance that could occur. This makes your code rocksolid and saves you from doong edgecase-debugsessions.

Have you looked into using the SWS-functions who access ini-files? They may help you getting over potential order problems.
Just look for functions with ProfileString in their names.
It’s definitely a bug. And REAPER will NOT work if you randomly change the line order of the file.

There obviously is a defined order. That’s why the lines are numbered.

Deny the obvious all you want, but it doesn’t change reality.

If it’s not a bug then why is @schwa fixing it???
__________________
Source-Destination 4-Point Editing for REAPER!
Available NOW for PC & Mac • FREE Trial License included
info@cohlerclassical.comhttps://cohlerclassical.com
cohler is offline   Reply With Quote
Old 05-27-2020, 11:30 AM   #7
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 10,955
Default

Not everything has to be a fight.

If you are parsing .ini files, you should be aware that entries can be in any order and there can be blank lines. This is true in general for any application that uses .ini files, and it is true for all REAPER .ini files...

... except this one file, reaper-menu.ini. REAPER does write this file in a particular sorted order as an optimization when parsing the file, and it's a bug that that sorting order changed, so thank you for reporting it.
schwa is offline   Reply With Quote
Old 05-27-2020, 11:56 AM   #8
cohler
Human being with feelings
 
Join Date: Dec 2018
Posts: 240
Default

Quote:
Originally Posted by schwa View Post
Not everything has to be a fight.

If you are parsing .ini files, you should be aware that entries can be in any order and there can be blank lines. This is true in general for any application that uses .ini files, and it is true for all REAPER .ini files...

... except this one file, reaper-menu.ini. REAPER does write this file in a particular sorted order as an optimization when parsing the file, and it's a bug that that sorting order changed, so thank you for reporting it.
Thank you. Yes, I am well aware, of everything you noted above. And I have already this morning rewritten my software to work around this bug in any case.

And I agree that not everything has to be a fight.

That is precisely why it's better not to accuse customers who have reported a rather obvious bug of being incorrect and claiming it's not a bug, but rather an "unintended change", and on and on with the blame-the-customer-first school of customer support.

I appreciate the fast response.
__________________
Source-Destination 4-Point Editing for REAPER!
Available NOW for PC & Mac • FREE Trial License included
info@cohlerclassical.comhttps://cohlerclassical.com
cohler is offline   Reply With Quote
Old 05-27-2020, 02:38 PM   #9
Icchan
Human being with feelings
 
Icchan's Avatar
 
Join Date: Dec 2011
Location: Finland
Posts: 582
Default

Quote:
Originally Posted by cohler View Post
That is precisely why it's better not to accuse customers who have reported a rather obvious bug of being incorrect and claiming it's not a bug, but rather an "unintended change", and on and on with the blame-the-customer-first school of customer support.
You have never gone to a class in basic programming paradigms and conventions now have you? I mean it's NEVER a good idea to trust the data to be in any way ordered UNLESS IT SPECIFICALLY IS GUARANTEED BY THE PROVIDER INTERFACE TO BE SO (which would be clearly stated in the .ini file or in REAPER docs or API help if that was the case) and you always sort the incoming data according to your own needs and then process it.

That's the basics of any data handling.

You're in the wrong in making an assumption, regardless if the change in sorting was "unintended behaviour", there's no guarantee for the sorting and it can change at any time...

First step to failure is making an assumption. I should know, i learned it the hard way. (Yes, I'm a programmer, even if not a professional one)

So don't take things personally, but learn from them. If you take something personally or start to feel entitled to something, you're on the wrong road. That's how fights start
Icchan is offline   Reply With Quote
Old 05-28-2020, 06:03 AM   #10
cohler
Human being with feelings
 
Join Date: Dec 2018
Posts: 240
Default

Quote:
Originally Posted by Icchan View Post
...it's NEVER a good idea to trust the data to be in any way ordered UNLESS IT SPECIFICALLY IS GUARANTEED BY THE PROVIDER INTERFACE TO BE SO
Agreed. And it clearly is so-documented. Like so many things in REAPER, which lacks detailed API documentation, it is self-documented in the coding and use of the reaper-menu.ini file itself, which as noted by @schwa is a very special ini file unlike most (or all) of the others, in that it does use a specific line order (indeed the lines are numbered!).

Again, as @schwa noted, it will be fixed, so it clearly is a bug.

If it wasn't a bug, it wouldn't need fixing, now would it? And I nor you would want the devs wasting their time fixing non-bugs would we? (last post on this subject)
__________________
Source-Destination 4-Point Editing for REAPER!
Available NOW for PC & Mac • FREE Trial License included
info@cohlerclassical.comhttps://cohlerclassical.com
cohler is offline   Reply With Quote
Old 05-28-2020, 06:44 AM   #11
White Tie
Pixel Pusher
 
White Tie's Avatar
 
Join Date: Mar 2007
Location: Blighty
Posts: 3,054
Default

Please don't ever get into theming.
__________________
The House of White Tie
White Tie is offline   Reply With Quote
Old 05-28-2020, 11:50 PM   #12
gmgmgm
Human being with feelings
 
Join Date: Jan 2013
Posts: 159
Default

Quote:
Originally Posted by White Tie View Post
Please don't ever get into theming.
That gave me such a chuckle.

White Tie, you really are a treasure.
gmgmgm is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:56 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.