Hi,

I'm trying to pass a command line argument to a Gforth program which is the name of a directory to change into at program start, where the data files are kept. The code in question is:

        argc if
                next-arg set-dir
        endif

at the very start of a word called at the start of a word used to replace bootmessage.

The error message in question is:

in file included from *args*:1:1:
Example2026:0:1: error: Is a directory
>>><<<
Backtrace:
/usr/local/share/gforth/0.7.9_20260109/kernel/input.fs:93:25: 0 $7F7AE0818300 throw
...

which seems to mean Gforth is parsing these arguments itself rather than passing them on.

The echo.fs example copied verbatim from section 6.25, and called the same way, has roughly the same problem:

*args*:2:1: error: No such file or directory
>>>hello<<<
Backtrace:
/usr/local/share/gforth/0.7.9_20260109/kernel/require.fs:112:15: 0 $7F430EA1ECB8 throw /usr/local/share/gforth/0.7.9_20260109/kernel/args.fs:113:28: 1 $7F430EA1F7C8 execute

Am I missing something or is the documentation just wrong?

--
Shawn K. Quinn <[email protected]>


Reply via email to