Diff for /gforth/kernel/args.fs between versions 1.16 and 1.17

version 1.16, 2003/03/09 15:17:04 version 1.17, 2004/01/16 21:27:31
Line 38  Variable argv ( -- addr ) \ gforth Line 38  Variable argv ( -- addr ) \ gforth
 Variable argc ( -- addr ) \ gforth  Variable argc ( -- addr ) \ gforth
 \g @code{Variable} -- the number of command-line arguments (including the command name).  \g @code{Variable} -- the number of command-line arguments (including the command name).
   
   0 Value arg# ( -- addr ) \ gforth
   \g While processing the OS command line arguments, this points to the
   \g argument counter (otherwise @code{arg#} produces 0); @code{arg# @
   \g arg} produces the current argument, @code{1 arg# +!} will result in
   \g one argument being skipped, and @code{argc @ 1- arg# !} will skip
   \g all further arguments.  Don't increase @code{arg# @} above
   \g @code{argc @ 1-} (undefined behaviour)!
       
 0 Value script? ( -- flag )  0 Value script? ( -- flag )
   
 : do-option ( addr1 len1 addr2 len2 -- n )  : do-option ( addr1 len1 addr2 len2 -- n )
Line 61  Variable argc ( -- addr ) \ gforth Line 69  Variable argc ( -- addr ) \ gforth
 \    >tib @ >r #tib @ >r >in @ >r  \    >tib @ >r #tib @ >r >in @ >r
     argc @ 1      argc @ 1
     ?DO      ?DO
           rp@ to arg#
         I arg over c@ [char] - <>          I arg over c@ [char] - <>
         IF          IF
 \           2dup dup #tib ! >in ! >tib !  \           2dup dup #tib ! >in ! >tib !
Line 71  Variable argc ( -- addr ) \ gforth Line 80  Variable argc ( -- addr ) \ gforth
         THEN          THEN
     +LOOP      +LOOP
 \    r> >in ! r> #tib ! r> >tib !  \    r> >in ! r> #tib ! r> >tib !
       0 to arg#
     false to script?      false to script?
 ;  ;
   

Removed from v.1.16  
changed lines
  Added in v.1.17


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>