Page 1 of 1

List variable support for Input Dialog

Posted: 30 Jul 2014 20:54
by kintrupf
When I use the action Input Dialog with the dialog type Single Choice or Multi Choice the option List values is used to supply the menu items.
Right now this option only accepts a string with items separated by commas. Variables are supported, but again only if they are a single string.

I have to construct this string manually even if I have the items in a list variable beforehand.
I have to check if any of the list items contains a comma and remove it.
I have to remove any blanks in front of the items to avoid any unwanted indentation in the Input dialog.

Even if I use the "build-in" support to convert a list into a comma-separated string I have to do some additional processing, like:

Code: Select all

lstString = replace({lst},'[', '');          // convert to comma-separated string and remove leading '['
lstString = replace(lstString,']', '');     // remove trailing '['
lstString = replace(lstString,', ', ',');   // remove leading blanks from items
Would it be possible to directly support list variables?
If a list item containes a comma it shouldn't matter, the items are already separated.
Leading and trailing spaces should be removed automatically.

Re: List variable support for Input Dialog

Posted: 31 Jul 2014 01:55
by angelatwork
I second that :-), I have spent quite a lot of time to make it work.

Re: List variable support for Input Dialog

Posted: 01 Aug 2014 07:22
by Martin
You can convert a list into a proper comma separated list with {list,listformat,comma}. There's also an example available when you press the [...]-button in the input dialog action.
I have planned to improve the examples to also list the available local and global variables so it should become to select the input values in a future version.

Re: List variable support for Input Dialog

Posted: 01 Aug 2014 11:51
by angelatwork
In my case,I meant when converting, before writing a list to a file (vertical, .csv). It is already the object list (list,listformat,comma), but when I want to save it to file, as a sorted, with no empty spaces in front of the item, vertical list, I have to do a lot of the scripting above and some more. Just explaining :-)