Page 1 of 1

ListIcon Column Seperator Options

Posted: Thu Aug 04, 2016 2:13 pm
by IdeasVacuum
Currently, if a ListIcon has more than one column, a whole Row can be added in one go with each Cell seperated with Chr(10) [=#LF$], like this:

Code: Select all

AddGadgetItem(iMyList, -1, "MyCol0" + #LF$ + "MyCol1" + #LF$ + "MyCol2")
However, when processing files, #LF$ is not a good choice - If, for example, I have a file whose Row Cells are seperated by commas, tabs or vertical bar chars, I'd like to 'tell' the ListIcon to accept the file's seperator instead of having to preprocess the file to change the seperator.

Edit: This would also enable the ability to extract (Get) a whole row instead of one-cell-at-a-time

Re: ListIcon Column Seperator Options

Posted: Wed Sep 07, 2016 11:09 pm
by netmaestro
Commas could be problematic as they might be found in data such as numbers that use the comma for a decimal point, name fields like "Smith, John" etc. and there are lots of other scenarios where a comma could appear. But the concept of being able to write SetGadgetAttribute(#listicon, #PB_Listicon_Separator, <some string>) would be attractive imho.

Re: ListIcon Column Seperator Options

Posted: Thu Sep 08, 2016 1:35 pm
by ebs
I'm probably stating the obvious, but a simple workaround that I use is:

Code: Select all

AddGadgetItem(iMyList, ReplaceString(RecordWithTabs, #TAB$, #LF$))

Re: ListIcon Column Seperator Options

Posted: Fri Sep 09, 2016 9:52 pm
by IdeasVacuum
That is what we have to do now ebs. We also have to do the reverse when saving ListIcon data to file.

The Utopian is for the file and the ListIcon to share the same seperator. Given that, we should be able to have a couple of much faster, simpler functions:

ListIconLoadFile(#PB_Seperator_xx)
ListIconSaveFile(#PB_Seperator_xx)