User Tools

Site Tools


lua:sharedtable

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
lua:sharedtable [2015/09/28 13:14] vodurlua:sharedtable [2015/09/28 16:36] (current) vodur
Line 128: Line 128:
 ==== Sharing with different prog types ==== ==== Sharing with different prog types ====
  
-All prog types have access to 'shared' table (mprog/oprog/aprog/rprog). However, if all your shared code is in mprog 1234 (as above example), only mprogs can easily load this code using loadprog. Loadprog called from oprog can only load oprogs, and similarly with aprog and rprog.+All prog types have access to 'shared' table (mprog/oprog/aprog/rprog). However, if all your shared code is in mprog 1234 (as above example), only mprogs can easily load this code using [[:lua:ch:loadprog|loadprog]]. Loadprog called from oprog can only load oprogs, and similarly with aprog and rprog.
  
 One strategy to overcome this limitation is to keep all the shared code in an aprog and load it from the different prog types accordingly: One strategy to overcome this limitation is to keep all the shared code in an aprog and load it from the different prog types accordingly:
Line 175: Line 175:
 </code> </code>
  
-'loadscript' is also an option for this purpose:+Using '**[[:lua:loadscriptfunction|loadscript]]**' is also an option:
  
 <code lua> <code lua>
lua/sharedtable.1443446043.txt.gz · Last modified: 2015/09/28 13:14 by vodur