Chapter Contents

Previous

Next
CURWORD

CURWORD



Returns the word that is at the cursor position

Category: Widget or Field


Syntax
Details
Example
See Also

Syntax

word=CURWORD();

word
is the text of the word.

Type: Character


Details

CURWORD returns the word on which the text cursor was located when the user last pressed ENTER. The retrieved character string begins with the first character of the word on which the cursor was positioned and extends to the first space after the word. CURWORD is usually used in conjunction with a CONTROL statement that includes the ENTER, ALWAYS, or ALLCMDS option.

If CURWORD is used on a window variable that has been modified, the field value is justified before CURWORD executes.


Example

Suppose a PROGRAM entry window contains text entry widgets that contain the words PROJECT1 and PROJECT2. The entry's program determines which action to perform by determining which word the cursor is positioned on when the user presses ENTER.

INIT:
   widget enter;
return;
MAIN:
   word=curword();
   if (word='PROJECT1') then
      submit continue;
         proc print data=project1;
         run;
      endsubmit;
   else if (word='PROJECT2') then
      submit continue;
         proc print data=project2;
         run;
      endsubmit;
   else _msg_=
     'Please position the cursor on a valid selection.';
return;

TERM:
return;

See Also

CONTROL

CURFLD

CURSOR

LOOKUPC


Chapter Contents

Previous

Next

Top of Page

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