lua:sharedtable
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| lua:sharedtable [2015/09/28 13:13] – vodur | lua: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 ' | + | All prog types have access to ' |
| 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: | ||
| </ | </ | ||
| - | ' | + | Using '**[[: |
| <code lua> | <code lua> | ||
| - | |||
| - | < | ||
| -- helpers_example.lua, | -- helpers_example.lua, | ||
| if shared.helpers_loaded then return | if shared.helpers_loaded then return | ||
| Line 195: | Line 193: | ||
| <code lua> | <code lua> | ||
| - | |||
| - | < | ||
| -- aprog 1235 | -- aprog 1235 | ||
| loadscript(' | loadscript(' | ||
| Line 204: | Line 200: | ||
| <code lua> | <code lua> | ||
| - | |||
| - | < | ||
| -- mprog 1234 | -- mprog 1234 | ||
| loadscript(' | loadscript(' | ||
| Line 213: | Line 207: | ||
| <code lua> | <code lua> | ||
| - | |||
| - | < | ||
| -- oprog 1234 | -- oprog 1234 | ||
| loadscript(' | loadscript(' | ||
| Line 222: | Line 214: | ||
| <code lua> | <code lua> | ||
| - | |||
| - | < | ||
| -- rprog 1234 | -- rprog 1234 | ||
| loadscript(' | loadscript(' | ||
lua/sharedtable.1443446011.txt.gz · Last modified: 2015/09/28 13:13 by vodur