*  ===============================================================
*                   Sample SENDKEY BASIC Program
*
*                            SENDKEY
*
*  Demonstrates the use of the SENDKEY.SCR file to send
*  keystrokes from the host application to a Windows
*  application.
*
*           Copyright CLEARVIEW Software Inc. 1992, 1993
*                      All Rights Reserved
*  ===============================================================
*
*
* =================================================================
*  Assign the API string prefix
* =================================================================

      MAGIC=CHAR(127)
*
*
* =================================================================
*  Send the API to Co*Star using the following output:
*
*   Output                  Description
*   ---------------------   ---------------------------------------
*   MAGIC:"UWSCRIPT         API for executing external script file
*
*   sdk\sendkey.scr         Path and filename for the script file
*
*   File Name               The filename or Window title of the
*                           Windows application to send keystrokes
*                           to.
*
*   MAGIC                   API terminator.
*
*
*   keystrokes              A series of keystrokes -- can be
*                           seperated by a comma.  The total
*                           length of the string of keystrokes
*                           must be less than 256 characters.
*
*
* =================================================================
*
*
*   Find or start up Microsoft Excel and send numbers from
*   the DATA statement into the spreadsheet.
*
      PRINT MAGIC:"UWSCRIPTsdk\sendkey.scr,Excel":MAGIC

*
*   If you don't have Excel you can try Windows Notepad.  Replace
*   the line above with Excel with the line below.
*
*     PRINT MAGIC:"UWSCRIPTsdk\sendkey.scr,NotePad":MAGIC
*
* ===========================
*  Send some numbers to Excel
* ===========================
*
*
* ===================================================================
*   Data statements for example program. These numbers could be read
*   from a data file as well.
* ===================================================================

      DATA 25,30,35,40,45
      DATA 50,55,60,65,70
      DATA 75,80,85,90,95
      DATA 100,105,110,115,120
      DATA 125,130,135,140,145
      DATA 150,155,160,165,170
      DATA 175,180,185,190,195
      DATA 200,205,210,215,220
      DATA 225,230,235,240,245

      FOR ROWS=1 TO 9

         FOR COLS=1 TO 5

*  You need to turn off any displays to the screen

            EXECUTE "PTERM ECHO OFF"

            INPUT NUMBER

            EXECUTE "PTERM ECHO ON"

*  You can now turn the display back on.
*
*  The {TAB} will position you for input into the spreadsheets
*  next cell to the right.

            PRINT @(1,1):NUMBER:"{TAB}":

         NEXT COLS

*
*  The {DOWN}{HOME} will position you down the next row within the
*  spreadsheet and position you to the first cell of that row.

         PRINT @(1,1):"{DOWN}{HOME},":

      NEXT ROWS

*
*  End the script macro

      PRINT MAGIC:

   END
