View Single Post
Old 10-27-2019, 08:22 PM   #520
Zamyen
Human being with feelings
 
Join Date: Dec 2008
Posts: 78
Default

I have seen this statement in a few lua scripts and had to include it in some of my own scripts calling Main_OnCommand

for key in pairs(reaper) do _G[key]=reaper[key] end

Could someone who knows a lot more about this explain why this is necessary? (copying the functions to the Lua global namespace?)

Printing the same keys to console is an expensive operation, as more functions are added any scripts with this command would slow down over time also.

Is there any way to do this more efficiently e.g. copying specific/selected functions to the Lua global?

Thanks a lot in advance for such a basic question.
Zamyen is offline   Reply With Quote