omit via loop

Questions, tips and tricks and techniques for scripting in Servoy

Re: omit via loop

Postby John » Thu Jun 04, 2009 10:07 pm

Johan,

I added a sample solution that demonstrates the problem to case id 215729.
The same code is below if anybody else wants to test it. Here are results I got.
before omit: 3 2 1
after omit: 1 2

Thank you.

John

Code: Select all
function onShow()
{
   foundset.deleteAllRecords();
   for (var i = 1; i <= 3; i++)
   {
      foundset.newRecord();
      foundset.sample_text = 'a';
   }
   // Sort on non-unique column.
   foundset.sort('sample_text asc');
   
   // Output order.
   var order = 'before omit:';
   for (var i = 1; i <= foundset.getSize(); i++)
   {
      order += ' ' + foundset.getRecord(i).sample_table_id;
   }
   application.output(order);
   
   // Call omitRecord().
   foundset.omitRecord(1);
   
   // Output order.
   var order = 'after omit:';
   for (var i = 1; i <= foundset.getSize(); i++)
   {
      order += ' ' + foundset.getRecord(i).sample_table_id;
   }
   application.output(order)
}
John
 
Posts: 7
Joined: Thu Jun 05, 2008 11:44 pm

Previous

Return to Methods

Who is online

Users browsing this forum: No registered users and 44 guests

cron