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

[Solved] List out all functions and APIs

Started by lieudusty, 02 February 2013 - 06:03 PM
lieudusty #1
Posted 02 February 2013 - 07:03 PM
Hi everyone! :D/>

I'm making a program and I need to disable all other functions except for print. Is there a way to list out all the functions and APIs?
GravityScore #2
Posted 02 February 2013 - 07:43 PM

for i = 0, 1 do
  for k, v in pairs(getfenv(i)) do
    print(k .. "  " .. v)
  end
end

EDIT: Improved it slightly… xD
lieudusty #3
Posted 02 February 2013 - 07:56 PM

for k, v in pairs(getfenv(0)) do
  print(k .. "  " .. v)
end


for k, v in pairs(getfenv(1)) do
  print(k .. "  " .. v)
end
Thanks :D/>
P.S HA YOU ARE ALIVE AFTER ALLLL (I couldn't find you on skype)