This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Sewbacca's profile picture

Get function Code

Started by Sewbacca, 17 January 2016 - 07:40 PM
Sewbacca #1
Posted 17 January 2016 - 08:40 PM
Is there a way to get the code of a function, without sub it out the program (I mean string.sub(…))?
Creator #2
Posted 17 January 2016 - 08:58 PM
string.dump(thefunction), but it will error when you dump a java function.
apemanzilla #3
Posted 17 January 2016 - 09:45 PM
string.dump(thefunction), but it will error when you dump a java function.

That gets the bytecode for a function. Hardly useful at all, and definitely not what OP was looking for.
Bomb Bloke #4
Posted 17 January 2016 - 09:55 PM
Is there a way to get the code of a function, without sub it out the program (I mean string.sub(…))?

You can use other string library functions, but long story short, you need access to the original source to do anything with the original source.
Sewbacca #5
Posted 18 January 2016 - 06:16 PM
Thanks anyway