Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR LUA

lua convert function to string

-- You cant just convert a function to a string
-- Functions are functions and strings are strings
-- You can convert its representation in memory to a string

tostring(func_name)

-- although thatll just give you something like:
-- <function at 0xF0103ab9c>
-- If you really want to convert a function to a string youll need to read
-- its actual source from a file, you can do a few neat things to get this 
--
-- I suggest reading about debug.getinfo for this if you wanna read it dynamically.
 
PREVIOUS NEXT
Tagged: #lua #convert #function #string
ADD COMMENT
Topic
Name
1+2 =