lua-users home
lua-l archive

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



On 12/07/14 03:08 PM, Rena wrote:
On Sat, Jul 12, 2014 at 8:42 AM, Xavier Wang <weasley.wx@gmail.com> wrote:
> Probably you could change the label to be one that's valid in both, and then
> put the Lua label immediately afterward:
>
> goto myLabel
> ::myLabel::
>
> print("Hello world")
>
> --[[
> :myLabel
> @echo "Hello shell!"
> ::]]
>
> --
> Sent from my Game Boy.

But it will print "goto myLabel" on cmd console, Is there any way to avoid it?

--
regards,
Xavier Wang.


It looks like that's a problem with the original method as well. I suppose you could use @goto and invoke the script with something crazy like:
lua -e "load(io.open([[" .. %0 .. "]]):read('*a'):gsub('@goto', 'goto'))()"

--
Sent from my Game Boy.
What about:

goto myLabel
::myLabel::

print("Hello world")

--[[
:myLabel
:: not sure if it's "clear" or "cls"
cls
@echo "Hello shell!"
::]]