home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 376_01 / os2tool.000 / CURSOR.C < prev    next >
C/C++ Source or Header  |  1992-08-25  |  1KB  |  67 lines

  1. /*
  2. * CURSOR.C - Position the cursor on the screen.
  3. *
  4. *
  5. * PROGRAMMER:        Martti Ylikoski
  6. * CREATED:        29.11.1990
  7. * VERSION:        1.1
  8. *
  9. */
  10. #include <stdio.h>
  11. #include <string.h>
  12. #include <stdlib.h>
  13. #include <param.h>
  14. #include <paramstd.h>
  15.  
  16. #define INCL_VIO
  17. #include <os2.h>
  18.  
  19. static char *progname ;
  20.  
  21. extern unsigned long pflags ;
  22.  
  23. ParamEntry pentry[12] = {
  24.      "P", &ParamSetPause, 0,
  25.      "F", &ParamSetFold, 0,
  26.      "V", &ParamSetVerbose, 0,
  27.      "R", &ParamSetReport, 0,
  28.      "S", &ParamSetSubDirs, 0,
  29.      "?", &ParamSetHelp, 1,
  30.      "H", &ParamSetHelp, 1,
  31.      "NOD", &ParamSetNoDefault, 0,
  32.      "TEST", &ParamSetTest, 0,
  33.      "Y", &ParamSetYes, 0,
  34.      "N", &ParamSetTest, 0,
  35.      "\0", NULL, 0
  36. } ;
  37.  
  38. ParamBlock params = {
  39.     "/-",   IGNORECASE | NOPRIORITY | NOTRIGGERSALLOWED ,
  40.     pentry
  41. } ;
  42.  
  43. int main(int argc, char *argv[])
  44. {
  45. int row, col, i ;
  46.  
  47.    progname = argv[0] ;
  48.  
  49.    ParamHandle(¶ms, &argc, argv) ;
  50.  
  51.    if (argc < 3 || pflags & PA_HELP)
  52.    {
  53.       printf("usage: %s row col [text] \n", progname) ;
  54.       return( 1 ) ;
  55.    }
  56.  
  57.    row = atoi(argv[1]) ;
  58.    col = atoi(argv[2]) ;
  59.  
  60.    VioSetCurPos(row, col, 0) ;
  61.  
  62.    for (i = 3; i<argc ; i++)
  63.       puts(argv[i]) ;
  64.  
  65.    return( 0 ) ;
  66. }
  67.