Script for Locating an Entry when no Positioning is Available

RAMP-NL

Script for Locating an Entry when no Positioning is Available


A variation on the previous script is to find an entry in a list where there is no positioning available and we do not know which column holds the sought after value. In such scenario, for each row we'd have to traverse each cell. Note that for big lists this can be a time consuming task:

for (var intRowNo = 0; intRowNo < intRowCount; intRowNo++)

{

   /* Get the number of cells in this row. */

   var intColCount = GETVALUE("uDataGrid.ColCount");

   for (var intColNo = 0; intColNo < intColCount; intColNo++)

   {

      if ( GETVALUE("uDataGrid.Rows(" + intRowNo + ").Cells(" + intColNo + ").Text") == strCompare)

      {

         /* Type a 2 next to the first entry and press enter */

        SETVALUE("uDataGrid.Rows(" + intRowNo + ").Cells(0).Text", 2);

         SENDKEY(KeyEnter);

         break;

      }

   }

}

Note that the above script will only handle the first page in the list.