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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 12-22-2019, 06:39 AM   #1
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
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)
__________________
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
 

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 06:33 AM.


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