Jump to content

Recommended Posts

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

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 by Roger Cigol

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×