[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Getting Lua script name without legacy arg
- From: Geoff Richards <Ni1phahs@...>
- Date: Tue, 11 Nov 2008 13:37:08 +0000
On Mon, Nov 10, 2008 at 08:39:51AM -0800, Sam Roberts wrote:
> On Mon, Nov 10, 2008 at 7:58 AM, Geoff Richards <Ni1phahs@ungwe.org> wrote:
> > Hi,
> >
> > I've just realised that I'm using the old 'arg' global in a script rather
> > than the new vararg syntax, but I don't know an equivalent way to get the
> > value for arg[0]. I was using it to figure out a file's name based on
>
> arg is no longer used for varargs, but it does continue to be used as
> the table the lua executable places the argv into.
>
> So, your code is good.
You're quite right, my code still works with the legacy 'arg' feature
disabled, I was being misled by the fact that it isn't created when
running code entered interactively, which makes sense of course.