title: insert data into stringlist after doing comparison
body: <p>hi i have stringlist...in my stringlist if item_type&lt;> 'remark' and gL_dept&lt;>'' will checking the record..
  if the record in gl_dept have same value for example 400,400,401..the value for 400 comes out 2 times
  so only add 400 for one time only then it will go to next record..but my problem is
  when i do comparison if lstDept.indexOf(sdept)&lt;> -1 not going to this statement but it will back to this statement.. if (tblSODitemtype)..
  how can i add the value into my stringlist..</p>
  
  <pre><code>  lstDept := TStringList.Create;  
    tblSOD.DisableControls;  
    try       
      tblSOD.First;  
      while (not tblSOD.Eof) do begin  
        sDept := tblSODGL_DEPT.AsString;  
        if (tblSODITEM_TYPE.AsString &lt;&gt; 'REMARK') and  (tblSODGL_DEPT.AsString &lt;&gt; '' ) then begin  
           if lstDept.IndexOf(sDept) &lt;&gt; -1  then begin  
              lstDept.add(tblSODGL_DEPT.asstring);  
              tblSOD.Next;  
           end;    
        end;  
      end;  
    finally  
      tblSOD.EnableControls;  
      lstDept.Free;  
    end;  
  </code></pre>