poelzi@31: --[[-- jbe@46: return_value = -- return value of executed chunk poelzi@31: execute.load_chunk{ poelzi@31: file_path = file_path, -- path to a lua source or byte-code file poelzi@31: app = app, -- app name to use or the current will be used poelzi@31: module = module, -- module where chunk is located jbe@46: chunk = chunk -- filename of lua file to load (including filename extension) poelzi@32: id = id, -- id to be returned by param.get_id(...) during execution poelzi@32: params = params -- parameters to be returned by param.get(...) during execution poelzi@31: } poelzi@31: jbe@46: NOTE: execute.load_chunk{...} is DEPRECATED and replaced by execute.chunk{...}. Both functions differ in interpretation of argument "chunk" regarding the filename extenstion '.lua'. jbe@46: poelzi@31: This function loads and executes a lua file specified by a given path or constructs poelzi@31: a path to load from the module and chunk name. poelzi@31: poelzi@31: --]]-- poelzi@31: poelzi@31: function execute.load_chunk(args) jbe@46: local chunk_name jbe@46: if args.chunk then jbe@46: chunk_name = string.match(args.chunk, "^(.*)%.lua$") jbe@46: if not chunk_name then jbe@46: error('"chunk_name" does not end with \'.lua\'') jbe@46: end poelzi@31: end jbe@46: return execute.chunk{ jbe@46: file_path = args.file_path, jbe@46: app = args.app, jbe@46: module = args.module, jbe@46: chunk = chunk_name, jbe@46: id = args.id, jbe@46: params = args.params jbe@46: } poelzi@31: end