Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do I access the program name / argv[0] in Forth?

29 views
Skip to first unread message

andrew.p...@gmail.com

unread,
Oct 6, 2012, 9:57:23 AM10/6/12
to
The gforth docs (1) say to access arguments by calling next-arg, but this omits the program name, which would be printed in a C-like language.

Since argv[0] seems to be automatically removed from the argument vector in Forth, is there a special function I can call that does return it?

1 http://www.complang.tuwien.ac.at/forth/gforth/Docs-html/OS-command-line-arguments.html

m...@iae.nl

unread,
Oct 6, 2012, 10:05:12 AM10/6/12
to
It's documented right on the cited page?

0 arg ok
.s <2> 13642136 30 ok
type /cygdrive/c/gforth/gforth-fast ok

-marcel
0 new messages