I am trying to parse a variable that contains 2 columns. It's called FacList and looks list this:
FacID|DelRt
160|LCL
166|TMP
200|PRPL
201|PRPL
202|PRPL
203|PRPL
etc.
Spoiler
I am trying to use this list to create variables named by the 2nd column, and a unique value list for a user to select later on to call on those values.i.e.
User selects from Gui, Add, ListBox, Multi vDelChoice, %DelRtList%
Where DelRtList is all the unique values obtained from column 2, delimited by |
and I can collect all the FacID's that were associated with those DelRt's chosen by the user.
e.g. They choose PRPL, FBLCK, and FELPA and I get
40
41
42
43
200
201
202
203
93
91
97
Which I will then use for selecting items from a different program's listbox, but that part I can figure out.
I'm pulling the FacList from a MSSQL DB using ADOSQL(), and can control the delimiter, if that matters. So I guess I can just pull the DelRt's unique fields with SELECT DISTINCT, create the listbox for the user with those values, then hit up the SQL DB again using WHERE DelRt is in %DelRtList%, but I'd like to do only one query to the SQL DB, if possible. I'm sure there is a solution using loops and stringsplits but I am having a hard time wrapping my brain around them.