gforth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gforth] "-e bye" not working with a program


From: Marcos Cruz
Subject: Re: [gforth] "-e bye" not working with a program
Date: Mon, 11 Nov 2013 01:19:36 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

I found out the problem. It's this line from the Forth Foundation
Library's config.fs:

----------------------------------------------------------------
  0 argc !            \ tell gforth not to process any more arguments
----------------------------------------------------------------

The whole piece:

----------------------------------------------------------------
\ Command line arguments in gforth 32-bit
cell 4 = [IF]
argc @ 1- constant #args  ( -- n = Get the number of command line arguments )

0 argc !            \ tell gforth not to process any more arguments

: arg@  ( n -- c-addr u = Get the nth command line argument )
  dup #args u< IF
    1+ cells argv @ + @ cstring>sstring
  ELSE
    drop 0 0 
  THEN
;
[THEN]
----------------------------------------------------------------

I already posted here some time ago (2012-06-14) about the same line
causing problems with gforthmi, after contacting Dick van Oudheusden,
the author of FFL, who explained:

----------------------------------------------------------------
The line

0 argc !            \ tell gforth not to process any more arguments

prevents gforth interpreting command line arguments for the script and
not for gforth. The line works well with gforth and enables the
argument parser module in the ffl for gforth.

If the line isn't working for gfortmi, perhaps you should contact the
gforth team with this problem.
----------------------------------------------------------------

I will contact him again. I still don't understand why FFL resets the
arguments count, and only in 32-bit Gforth.  Anyway preventing "-e" from
working is undesirable.

-- 
Marcos Cruz
http://programandala.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]