0

I am creating a console application in which i am using lua integration. i have installed complier, binaries and also LuaRocks package manager.

Now i want to use json.lua file which is locted in my appliaction and want to use it to decode the json in lua function given below,

state.DoString(@"
        function ScriptFunc (input)

            local json = require('json')

            local JSON_string = input

            return json.decode(JSON_string) end"
        );

in Which require('json') function use my json.lua file. But i am confused about how to integrate this lua file with my function in above code.

  • Solution#1 is [here](https://stackoverflow.com/q/48342315/6834680) - place whole file in a huge string and execute it with `state.DoString`, Solution#2 is [here](https://stackoverflow.com/q/40333654/6834680) - modify `package.path` in your Lua state. – Egor Skriptunoff Jan 23 '18 at 16:21
  • thanx Egor i have solved it. – Nirmal Patel Jan 24 '18 at 05:18

0 Answers0