Chapter Contents

Previous

Next
Data Form and Data Table: _findRow

Data Form and Data Table: _findRow



Returns the number of the row and scrolls you to the row that meets the find request

Delegated to: Data Set Data Model class


Syntax
Details
Example
See Also

Syntax

CALL SEND (object-id,'_findRow', find-request<,startrow>);

Argument Type
Description
find-request
N specifies the identifier of an SCL list that contains the find request
startrow
N specifies the row on which to start the search. The search begins with startrow. If the find is successful, startrow returns the row number of the match, otherwise it returns -1. By default, if no start-row is defined, the search begins with the current row plus 1. If there is no current row, the search begins with row 1.


Details

The find request should contain one or more character list items. Each item can use standard WHERE clause syntax and is handled as an additional request. The _findRow method does not take advantage of an index that may exist on the SAS table.

When using a data form, the found row becomes the current row (i.e., the displayed row). When using a data table, the found row becomes the top row.

If a match is not found, the last row of the table is displayed along with the message:

Note: End of file reached without a match.

Note:   The _findRow method cannot be called from the model SCL.  [cautionend]


Example

The following example uses the _findRow method and the _repeatFindRow method. This example assumes you have created a frame with a data table named TABLE and two push buttons named BUTTON1 and BUTTON2.
 Note about code
length charval $ 15;

INIT:
   call send(_frame_,'_getWidget','table',tabid);
   call send(tabid,'_setDataset','sasuser.crime');
return;
 Note about code
BUTTON1:
   row=1;
   list=makelist();
   list=insertc(list,'STATE=10');
   list=insertc(list,'or upcase(staten)="DELAWARE"',-1);
   call send(tabid,'_findRow',list,row);
   if (row>0) then do;
      call send(tabid,'_getColumnText',
                'staten',charval);
      call send(tabid,'_getColumnValue',
                'state',numval);
      put row= charval= numval=;
   end;
   list=dellist(list);
return;
 Note about code
BUTTON2:
   row+1;
   call send(tabid,'_repeatFindRow',row);
   put row=;
return;

See Also

_repeatFindRow


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.