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

Reply
 
Thread Tools Display Modes
Old 05-27-2020, 06:41 AM   #1
cohler
Banned
 
Join Date: Dec 2018
Posts: 642
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,...

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: May 2017
Location: Leipzig
Posts: 6,621
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.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
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: 15,746
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
Banned
 
Join Date: Dec 2018
Posts: 642
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.
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: May 2017
Location: Leipzig
Posts: 6,621
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.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-27-2020, 11:16 AM   #6
cohler
Banned
 
Join Date: Dec 2018
Posts: 642
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???
cohler 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 01:03 AM.


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