Chapter Contents

Previous

Next
TOPROW

TOPROW



Scrolls a row to the top of an extended table

Category: Extended Table


Syntax
Details
Examples
Example 1: Specifying Which Row to Scroll
Example 2: Letting the Program Determine Which Row to Scroll
See Also

Syntax

CALL TOPROW(row);

row
is the number of the table row to be scrolled to the top of the table.

Type: Numeric


Details

The TOPROW routine cannot be called in the getrow or putrow section of an SCL program.

You can use TOPROW only on extended tables in PROGRAM entries. Because you can define extended tables only in SAS/AF software, you cannot use TOPROW in FSEDIT or FSVIEW programs.


Examples

Example 1: Specifying Which Row to Scroll

Scroll the fifth row to the top of the table:

call toprow(5);

Example 2: Letting the Program Determine Which Row to Scroll

Suppose you have a PROGRAM entry window that contains three character fields:

  1. VALUE, in the non-scrollable area of the window. Turn the CAPS attribute off for VALUE.

  2. NAME, the first field in the extended table's logical row. Turn the CAPS attribute off for NAME.

  3. GENDER, the second field in the extended table's logical row.

When a user enters a name in VALUE, the table scrolls so that the corresponding row is at the top of the table.

This program controls the window:

INIT:
  dsid=open('sasuser.class');
  call set(dsid);
  call setrow(0,0,'','y');
  vnum=varnum(dsid,'name');
return;
MAIN:
rc=
where(dsid,"name contains '"||value|| "'");
 any=attrn(dsid,'any');
  if any then do;
    rc=fetch(dsid);
    firstmatch=getvarc(dsid,vnum);
    rc=where(dsid);
    recnum=locatec(dsid,vnum, firstmatch);
    call toprow(recnum);
  end;
return;

TERM:
  if dsid then dsid=close(dsid);
return;

getrow:
  if fetchobs(dsid,_currow_)=-1
   then call endtable();
return;

See Also

CURTOP

ENDTABLE

SETROW


Chapter Contents

Previous

Next

Top of Page

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