Chapter Contents

Previous

Next
Data Set Data Model: _findRow

Data Set Data Model: _findRow



Returns the number of the row that meets the find request and makes that row the current row


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.


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,'_get_column_value_','state',numval);
     put row= charval= numval=;
   end;
   rc=dellist(list);
return;
 Note about code
BUTTON2:
   row+1;
   call send(tabid,'_repeatFindRow',row);
   put row=;
return;

See Also

_repeatFindRow.

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


Chapter Contents

Previous

Next

Top of Page

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