title: Delphi/pascal Parse a string to a combobox
body: <p>I'm trying to parse a string (sys) that looks exactly like this</p>
  
  <pre><code>-1|low
  0|normal
  1|high
  </code></pre>
  
  <p>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:</p>
  
  <pre><code> var
   sys : String;
   InputLine : TStringList;
  
     InputLine := TStringList.Create;
     InputLine.Delimiter := '|';
     InputLine.DelimitedText := sys;
     Combobox1.items.AddStrings(InputLine);
     FreeAndNil(InputLine)
  </code></pre>
  
  <p>This gives each line of the combo box as such:</p>
  
  <pre><code> -1
   low
   0
   normal
   1
   high
  </code></pre>