Chapter Contents

Previous

Next
Data Set Model: _findRow

Data Set Model: _findRow



Returns the number of the row that meets the find request


Syntax
Details
Example
See Also

Syntax

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

Argument Type Description
find-request
N specifies the identifier of an SCL list that contains the find request
start-row
N specifies the row to start the search on. The search begins with start-row. If the find is successful, start-row 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

If you modify the current row in the table, you must use the _updateRow method before calling the _findRow method.

The find request should contain one or more character list items. Each item should use standard WHERE clause syntax and is handled as an additional request.

If the end of the table is reached without a match, the last row of the table becomes the current row. If the last _findRow or _repeatFindRow reached the end without a match, the search begins at the beginning of the table.


Example

In the following example, the Data Set Model class is being used as a stand-alone model, that is, the model class is not being used with a data form or data table object.

This example uses the _findRow method and the _repeatFindRow method. The example assumes you have created a FRAME entry with two push buttons named BUTTON1 and BUTTON2.

length charval $ 15;
 Note about code
INIT:
   datcl=loadclass('sashelp.fsp.datast_m.class');
   datid=instance(datcl);
 Note about code
   call send(datid, '_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(datid,'_findRow',list,row);
   call send(datid,'_getColumnText',
            'staten',charval);
   call send(datid,'_getColumnValue',
            'state',numval);
   put row= charval= numval=;
   list=dellist(list);
 return;
 Note about code
BUTTON2:
  row+1;
  call send(datid, '_repeatFindRow', row);
  put row=;
return;
 Note about code
TERM:
   call send(datid,'_term');
 return;

See Also

_repeatFindRow.


Chapter Contents

Previous

Next

Top of Page

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