Traverse Grid data

Hello,

I want to do something that I would think would be simple yet I am not sure how this is done. How can I traverse through the records in a grid so I can print out their details in the infolog?

Thank you!

IN DS->Execute query ()

while select DSName

{

info(DSname.field);

}

Hi ,

You can traverse the selected grid records using following code(Suppose for the ProdTable)-

ProdTable prodTableRecord;
;
for (prodTableRecord = prodTable_DS.getFirst(1) ? prodTable_DS.getFirst(1) : ProdTable; prodTableRecord;prodTableRecord=prodTable_DS.getNext())
{
//Do Something what you want
}

Regards,
Vinay

Nevermind, the answer is:

void method()
{
Table table;

int value;

//looping the datasource

for (table = table_ds.getFirst(); table; table = table_ds.getNext())
{
value += table.intField;
}
}