home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / 123rexx.zip / REXXARGS.CMD < prev    next >
OS/2 REXX Batch file  |  1991-10-21  |  2KB  |  34 lines

  1. /*****************************************************************************/
  2. /* Lotus 1-2-3 For OS/2 sample @function.                                    */
  3. /*                                                                           */
  4. /* @REXX("REXXARGS.CMD",[arg1,arg2...])                                      */
  5. /*                                                                           */
  6. /* Returns the number of arguments passed to it.                             */
  7. /*                                                                           */
  8. /* @REXX("REXXABRV.CMD logFileName",[arg1,arg2...]))                         */
  9. /*                                                                           */
  10. /* Writes any TRACE or SAY output to a log file named 'logFileName'.         */
  11. /*                                                                           */
  12. /* Copyright (c) 1991 Lotus Development Corporation.  This code is supplied  */
  13. /* on an 'as is' basis as an example only.  This code has only received      */
  14. /* informal testing by Lotus.  Permission is granted  to copy and modify     */
  15. /* this code to your heart's content.  No warrenties expressed or implied.   */
  16. /* Remember, your mileage may vary.  Let us know if you find support of REXX */
  17. /* by 1-2-3 useful.                                                          */
  18. /*****************************************************************************/
  19.  
  20. PARSE ARG arg.1, arg.2, arg.3, arg.4, arg.5, arg.6, arg.7, arg.8, arg.9, ,
  21.    arg.10, arg.11, arg.12, arg.13, arg.14, arg.15, arg.16, arg.17, arg.18,
  22.    arg.19, arg.20
  23. IF arg.1 = "?" THEN SIGNAL Tell   /* give info if called with "?" as 1st arg */
  24. numArgs = 0
  25. DO i = 1 TO 20                                 /* loop through the arguments */
  26.    IF arg.i <> "" THEN                       /* do we have an argument here? */
  27.       numArgs = numArgs + 1         /* bump the count of args we were passed */
  28.    END
  29. RETURN numArgs
  30.  
  31. Tell:                                          /* return a brief description */
  32. RETURN '@REXX("REXXARGS.CMD",[arg1,arg2...]) ==> returns number of args',
  33.    "it was passed."
  34.