title: delphi dictionary iterating
body: <p>g'morning!</p>
  
  <p>i fill a dictionary <code>TDictionary&lt;String, TStringlist&gt;</code> (delphi-collections-unit) with strings as values and several strings as values.
  something like: </p>
  
  <ul>
  <li>names = john, lisa, stan</li>
  <li>skills = read, write, speak</li>
  <li>ages = 12, 14, 16</li>
  </ul>
  
  <p>(without "," of course).
  what i need is to iterate this dictionary and to multiply out the values with the keys.
  output should be like </p>
  
  <ul>
  <li>names = john skills = read ages = 12</li>
  <li>names = john skills = read ages = 14</li>
  <li>names = john skills = read ages = 16</li>
  <li>names = john skills = write ages = 12</li>
  <li>names = john skills = write ages = 14</li>
  <li>names = john skills = write ages = 16</li>
  <li>...</li>
  <li>names = lisa skills = read ages = 12 </li>
  <li>...</li>
  <li>names = stan skills = speak ages = 16</li>
  </ul>
  
  <p>so every combination. 
  how can i do so? the number of keys is dynamic and so is the size of the tstringlist.
  thanks! SOLVED by now...</p>
  
  <p>now the problem with the scope. following is the procedure that fills the dict. the subsplits and the splitstring are stringlists, that get freed at the end of the procedure. the dict is created after the procedures-block (in main? how is it called?), the fill-method is called and then i want to do recursion like in the code-example but there are no values in the dict....</p>
  
  <pre><code>while not Eof(testfile) do
    begin
      ReadLn(testfile, text);
      if AnsiContainsStr(text, '=') then
      begin
        Split('=', text, splitarray);
        splitarray[0] := trim(splitarray[0]);
        splitarray[1] := DeleteSpaces(splitarray[1]);
        if AnsiStartsStr('data', splitarray[0]) then
        begin
          split(' ', splitarray[0], subsplit1);
          splitarray[0]:=subsplit1[1];
          split(',', splitarray[1], subsplit2);
          dict.Add(splitarray[0], subsplit2);
          for ValueName in dict.Values do
          begin
            for i := 0 to Valuename.Count - 1 do
            write('Values are : '+ Valuename[i]);
          writeln;
          end;//
        end;//
      end;//
    end;//
  </code></pre>