Henry Olive 5 Posted February 22 Good Day, I have a StringList like below (total 4 rows) ITEMCODE...QTY 01-01.............10 (This Row is Empty) 01-02.............30 aaa I'd like to get JUST correct ITEMCODEs (According to my ITEMS table records) For example in above grid Empty Row and aaa dont available in ITEMS table so i want to skip them I only need '01-01' and '01-02' My Code is like below for i := 0 to SGrid1RowCount-1 do begin ItemNoCol:=SpinEditItemNo.Value; ItemNo:=SGrid1.Cells[ItemNoCol,i+2]; SQLDataset.Close; SQLDataset.CommandText :='SELECT ITEMCODE FROM ITEMS WHERE ITEMCODE='+QuotedStr(ItemNo); SQLDataset.Open; if (ItemNo='') or (SQLDataset.Fields[0].asString='') then ........ // I need a code here like Skip the row and go to next row else ...... ......... end; Thank You Share this post Link to post
Roger Cigol 107 Posted February 22 (edited) I don't actually see that you have to do anything here - just don't take any action for the case(s) you want to ignore. If you do want to skip an extra step you can always deliberately increment the counting value - ie use this line inside the loop.... i = i + 1; Edited February 22 by Roger Cigol Share this post Link to post