gforth
[Top][All Lists]
Advanced

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

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


From: Andrew Pennebaker
Subject: Re: [gforth] How do I access the program name / argv[0] in Forth?
Date: Wed, 10 Oct 2012 23:04:19 -0400


Ah, the name of the current source file is always 'sourcefilename'.  No matter
where in the command line it is - or if it is a command line at all.

That's weird, on my computer, sourcefilename doesn't return the filename at all. It returns the number 13:

Code:

https://github.com/mcandre/scriptname/blob/master/scriptname.fs

Trace:

$ ./scriptname.fs
Program: 13

--
Cheers,

Andrew Pennebaker
www.yellosoft.us

reply via email to

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