lua-users home
lua-l archive

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


Minardo Gollun Gonzalez Lopez wrote:
> I need a code, using Lua5.1.2 that allows me to load a Lua file and print the name of all the functions that have the document. Please any people that have an example or tutorial send It to me because I have not been able to make an example that loads lua and execute it correctly using the latest libraries.
>  
> Saludos: Ing. Minardo G. González López.
> 
> 
using lua.exe

execute lua dump_function.lua your_script.lua

dump_function.lua:

file = ...

dofile( file )

for key, value in pair( _G )
    if( isfunction( value ) ) then
        print( key .."\n" )
    end
end

It should do the stuff( I've not tested, but you get the idea )

-- 
--
Julien Hamaide
Engineering Coach
10Tacle Studios Belgium / Elsewhere Entertainment