Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
How to read table from another file — Gideros Forum

How to read table from another file

I have three files,main.lua, widgetcandy.lua, and theme.lua in a project. I have added all correctly. the widget file loads a theme with

"V.LoadTheme = function ( themeName, folderPath) --themeName = lua file of settings, folder path is where images and sounds for gui are

local i
local Theme

if V.Themes[themeName] ~= nil then V.error("!!! WIDGET ERROR: LoadTheme(): Theme '"..themeName.."' already loaded!"); return end

Theme = require(themeName)" -- this is line 1830

The theme file is basically a table of item/description pairs and goes like this

"local Theme =
{ Table of descriptor/value pairs
return Theme"

Main file just sets things up.
When I try to run a minimal file that tries to load the "theme" I keep getting an error

widget_candy.lua:1830: module 'theme' not found:
no field package.preload['theme']
no file '.\theme.lua'
no file '.\theme\init.lua'
no file '.\_LuaPlugins_\theme.lua'
no file '.\_LuaPlugins_\theme\init.lua'
no file 'D:\Gideros\lua\theme.lua'
no file 'D:\Gideros\lua\theme\init.lua'
no file 'D:\Gideros\theme.lua'
no file 'D:\Gideros\theme\init.lua'
no file '.\theme.dll'
no file 'D:\Gideros\theme.dll'
no file 'D:\Gideros\loadall.dll'
stack traceback:
widget_candy.lua:1830: in function 'LoadTheme'
main.lua:5: in main chunk"

The theme.lua is definitely in the directory '.\'
Anyone know what may be wrong? I'm lost.


Sign In or Register to comment.