I'm trying to parse a string (sys) that looks exactly like this
-1|low
0|normal
1|high
I need to pair them in a combo box, where for example, low is the caption and -1 will be the value. What is the best way to do this? What I have so far is:
var
sys : String;
InputLine : TStringList;
InputLine := TStringList.Create;
InputLine.Delimiter := '|';
InputLine.DelimitedText := sys;
Combobox1.items.AddStrings(InputLine);
FreeAndNil(InputLine)
This gives each line of the combo box as such:
-1
low
0
normal
1
high