I know theres lots of posts about delimitedtext, but I'm trying to work out the best way to allow my users to specify their preferred character via the interface, and I am not using a StringList, as referenced here (
https://www.freepascal.org/docs-html/rtl/classes/tstrings.delimitedtext.html).
So for example, currently, I use
'my string' + ',' + 'more of my string';
to place delimiters.
So I have set a labelled edit field in the GUI now. If the user wants to use ',' or ':' or any other printable character, I can use leDelimiterField.Text instead of ','.
'my string' + leDelimiterField.Text + 'more of my string';
I also notice it has .Text.IsDelimiter() but I am not quite sure how to use that in this context. I notice there is also TStringHelper.Split (
https://www.freepascal.org/docs-html/rtl/sysutils/tstringhelper.split.html) but again, I think it needs to be told what the delimiter character is, and I want my users to be able to choose that themselves.
Lets say the user wants to use tab (#9). So they enter the tab value of '#9' in the label edit field. If I use the text property still as above, then '#9' understandably gets inserted into the output string. And I'd prefer not to run a conversion routine for what might be millions of lines on that GUI element every time. I want to rapidly "set" the chosen delimiter when the user clicks a button (and I have that set to a comma currently but the user could choose ':' or tab) such that for every line thereafter that character is chosen, regardless of whether it is an ASCII selected value, or a non printable one like tab.
In other words, what I need to do is
1) User chooses a character, such as ':' or tab (#9) in the edit field
2) When user clicks button, program "gets" the chosen delimiter and sets it as ChosenDelimiter
3) For every string thereafter requring delimiter, ChosenDelimiter is used, whether it be printable ASCII, or not (i.e. tab)
How best might folks approach this? Is there a more suitable method than what I am doing here?