home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / forth / pfe-0.000 / pfe-0 / pfe-0.9.13 / demo / argument next >
Encoding:
Text File  |  1994-11-24  |  807 b   |  28 lines

  1. #! ../src/pfe -q
  2. \ ^ this space is vital.
  3. \
  4. \ This is a Forth file used as shell script.
  5. \
  6. \ This file is passed to the interpreter described with full path
  7. \ name in the first line. Please make shure that this path name is
  8. \ correct on your installation. (You'll HAVE to change it!)
  9. \
  10. \ Any arguments to the script file (this file) starting with the
  11. \ script file itself are visible inside pfe by means of the words:
  12. \
  13. \ ARGC ( --- n        ; count of parameters, at least 1 )
  14. \ ARGV ( n --- addr len    ; returns the n'th argument )
  15. \
  16. \ If you execute this script like any other shell command
  17. \ then you should see the parameters passed to this script.
  18. \
  19.  
  20. : DISPLAY-ARGUMENTS
  21.     ARGC 0 DO
  22.         CR I 2 .R  ."  ["  I ARGV TYPE  ." ]"
  23.     LOOP ;
  24.  
  25. .( These are the command line arguments of the script:)
  26. DISPLAY-ARGUMENTS
  27. BYE
  28.