home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 17 / CD_ASCQ_17_101194.iso / dos / prg / sphinx / examples / other / paramstr.c__ < prev    next >
Encoding:
Text File  |  1993-06-22  |  789 b   |  33 lines

  1. /*
  2.    SPHINX C-- example program
  3.    NAME:  PARAMSTR.C--
  4.    DESCRIPTION:  Parses and displays the command line passed from DOS.
  5. */
  6.  
  7. ? parsecommandline  TRUE   // enable installation of parameter parsing code
  8.  
  9. ?include "WRITE.H--"
  10. ?include "STRING.H--"
  11.  
  12. main ()
  13. word count,parameters;
  14. {
  15. WRITESTR("The command line is composed of ");
  16. parameters = @ PARAMCOUNT();
  17. WRITEWORD(parameters);
  18. WRITESTR(" string(s).\n");
  19. count = 0;
  20. IF( count < parameters )
  21.     {do {WRITESTR("string # ");
  22.          WRITEWORD(count);
  23.          WRITESTR(": \"");
  24.          WRITESTR(PARAMSTR(count)); 
  25.          WRITESTR("\" Length=");
  26.          WRITEWORD(STRLEN(PARAMSTR(count)));
  27.          WRITELN();
  28.          count++;
  29.          } while(count < parameters);
  30.     }
  31. }
  32.  
  33. /* end of PARAMSTR.C-- */