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

Reply
 
Thread Tools Display Modes
Old 12-22-2019, 06:39 AM   #1
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,885
Default API: GetUserInputs() has issues with quotes in parm "retvals_csv"

I noticed today, that entering quotes into the parameter retvals_csv in GetUserInputs produces weird results.
It seems like, the function sees contents within quotes as one string.
For instance, if I pass a string to it:
Code:
A\n\"B\nC\"D
and choose as separator \n, the default-retvals will be shown as

Code:
A
BC
D
though I would expect it to be like

Code:
A
"B
C"
D
thus putting quotes into default-retval is simply impossible.
This is difficult, if the user enters something like
Code:
"I'm"
"enlightened"
and I refeed the user's input the next time using GetUserInputs, it will be one line, though entered as two lines:

Code:
I'menlightened
That means, all newlines will be ignored after such a quote until a "closing quote" appears.

Here are some more examples for that:
Code:
-- Only one '
oldnotes="\'A\nB\nC"
retval, result = reaper.GetUserInputs(" ", 5, "Episode Title:,Author:,Podcast:,Podcast Category:,Description:,extrawidth=300, separator=\n", oldnotes)

-- Only one "
oldnotes="\"A\nB\nC"
retval, result = reaper.GetUserInputs(" ", 5, "Episode Title:,Author:,Podcast:,Podcast Category:,Description:,extrawidth=300, separator=\n", oldnotes)

-- Two ' in the string
oldnotes="\'A\nB\'\nC"
retval, result = reaper.GetUserInputs(" ", 5, "Episode Title:,Author:,Podcast:,Podcast Category:,Description:,extrawidth=300, separator=\n", oldnotes)

-- no quotes at all and it works, as it should be
oldnotes="A\nB\nC"
retval, result = reaper.GetUserInputs(" ", 5, "Episode Title:,Author:,Podcast:,Podcast Category:,Description:,extrawidth=300, separator=\n", oldnotes)
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 12-22-2019, 06:44 PM   #2
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 3,007
Default

Quote:
Originally Posted by mespotine View Post
It seems like, the function sees contents within quotes as one string.
That's common with CSV. Quotes are meant to allow using the separating character within a field. Usually literal double quotes are escaped by using another quote, but it looks like that is not supported here.

Last edited by cfillion; 12-22-2019 at 06:59 PM.
cfillion is offline   Reply With Quote
Old 12-23-2019, 10:44 AM   #3
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,885
Default

Yes, escapability would help solving this very much. Would be great.
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 01-14-2020, 02:11 PM   #4
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,885
Default

Bumby McBumpface
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635

Last edited by mespotine; 01-14-2020 at 02:19 PM.
mespotine 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 03:37 AM.


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