{"action":"created","issue":{"url":"https://api.github.com/repos/pkulchenko/ZeroBraneStudio/issues/582","labels_url":"https://api.github.com/repos/pkulchenko/ZeroBraneStudio/issues/582/labels{/name}","comments_url":"https://api.github.com/repos/pkulchenko/ZeroBraneStudio/issues/582/comments","events_url":"https://api.github.com/repos/pkulchenko/ZeroBraneStudio/issues/582/events","html_url":"https://github.com/pkulchenko/ZeroBraneStudio/issues/582","id":126448434,"number":582,"title":"arg and interpreter luaforwindows","user":{"login":"jjvbsag","id":8567887,"avatar_url":"https://avatars.githubusercontent.com/u/8567887?v=3","gravatar_id":"","url":"https://api.github.com/users/jjvbsag","html_url":"https://github.com/jjvbsag","followers_url":"https://api.github.com/users/jjvbsag/followers","following_url":"https://api.github.com/users/jjvbsag/following{/other_user}","gists_url":"https://api.github.com/users/jjvbsag/gists{/gist_id}","starred_url":"https://api.github.com/users/jjvbsag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjvbsag/subscriptions","organizations_url":"https://api.github.com/users/jjvbsag/orgs","repos_url":"https://api.github.com/users/jjvbsag/repos","events_url":"https://api.github.com/users/jjvbsag/events{/privacy}","received_events_url":"https://api.github.com/users/jjvbsag/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pkulchenko/ZeroBraneStudio/labels/Enhancement","name":"Enhancement","color":"02e10c"}],"state":"closed","locked":false,"assignee":{"login":"pkulchenko","id":77071,"avatar_url":"https://avatars.githubusercontent.com/u/77071?v=3","gravatar_id":"","url":"https://api.github.com/users/pkulchenko","html_url":"https://github.com/pkulchenko","followers_url":"https://api.github.com/users/pkulchenko/followers","following_url":"https://api.github.com/users/pkulchenko/following{/other_user}","gists_url":"https://api.github.com/users/pkulchenko/gists{/gist_id}","starred_url":"https://api.github.com/users/pkulchenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkulchenko/subscriptions","organizations_url":"https://api.github.com/users/pkulchenko/orgs","repos_url":"https://api.github.com/users/pkulchenko/repos","events_url":"https://api.github.com/users/pkulchenko/events{/privacy}","received_events_url":"https://api.github.com/users/pkulchenko/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2016-01-13T15:50:02Z","updated_at":"2016-01-14T10:44:07Z","closed_at":"2016-01-13T19:43:05Z","body":"Assume this little, tiny script:\r\n```lua\r\nfor k,v in pairs(arg) do\r\n\tprint(k,v)\r\nend\r\n```\r\n\r\nRunning this in ZBS with zbs-owned lua gives:\r\n```\r\nProgram starting as '\"C:\\bin\\zbStudio\\bin\\lua.exe\" -e \"io.stdout:setvbuf('no')\" \"C:\\Lua\\zbstudio-args\\show-args.lua\"'.\r\nProgram 'lua.exe' started in 'C:\\Lua\\zbstudio-args' (pid: 6628).\r\n0\tC:\\Lua\\zbstudio-args\\show-args.lua\r\n-2\t-e\r\n-1\tio.stdout:setvbuf('no')\r\n-3\tC:\\bin\\zbStudio\\bin\\lua.exe\r\nProgram completed in 0.02 seconds (pid: 6628).\r\n```\r\nthis is more or less the same on windows and linux.\r\n\r\nNow when I choose LuaForWindows in ZBS on windows, the result is:\r\n```\r\nProgram starting as '\"C:\\bin\\Lua\\5.1\\lua.exe\" -e \"xpcall(function() io.stdout:setvbuf('no'); dofile [[C:\\Lua\\zbstudio-args\\show-args.lua]] end,function(err) print(debug.traceback(err)) end)\"'.\r\nProgram 'lua.exe' started in 'C:\\Lua\\zbstudio-args' (pid: 3404).\r\nC:\\Lua\\zbstudio-args\\show-args.lua:1: bad argument #1 to 'pairs' (table expected, got nil)\r\nstack traceback:\r\n\t(command line):1: in function <(command line):1>\r\n\t[C]: in function 'pairs'\r\n\tC:\\Lua\\zbstudio-args\\show-args.lua:1: in main chunk\r\n\t[C]: in function 'dofile'\r\n\t(command line):1: in function <(command line):1>\r\n\t[C]: in function 'xpcall'\r\n\t(command line):1: in main chunk\r\n\t[C]: ?\r\nProgram completed in 0.03 seconds (pid: 3404).\r\n```\r\n\r\nWhen I run the same script in SCiTe, I get \r\n```\r\n>lua \"show-args.lua\" \r\n-1\tlua\r\n0\tshow-args.lua\r\n>Exit code: 0\r\n```\r\n\r\nso this is no problem of LuaForWindows, but in the way, lua is invoked by interpreters/lfw. There should be at least be an arg with arg[0] set to the script path.\r\nAlso Project / Command Line Parameters is disabled for LuaForWindows interpreter.  :disappointed:"},"comment":{"url":"https://api.github.com/repos/pkulchenko/ZeroBraneStudio/issues/comments/171609194","html_url":"https://github.com/pkulchenko/ZeroBraneStudio/issues/582#issuecomment-171609194","issue_url":"https://api.github.com/repos/pkulchenko/ZeroBraneStudio/issues/582","id":171609194,"user":{"login":"jjvbsag","id":8567887,"avatar_url":"https://avatars.githubusercontent.com/u/8567887?v=3","gravatar_id":"","url":"https://api.github.com/users/jjvbsag","html_url":"https://github.com/jjvbsag","followers_url":"https://api.github.com/users/jjvbsag/followers","following_url":"https://api.github.com/users/jjvbsag/following{/other_user}","gists_url":"https://api.github.com/users/jjvbsag/gists{/gist_id}","starred_url":"https://api.github.com/users/jjvbsag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjvbsag/subscriptions","organizations_url":"https://api.github.com/users/jjvbsag/orgs","repos_url":"https://api.github.com/users/jjvbsag/repos","events_url":"https://api.github.com/users/jjvbsag/events{/privacy}","received_events_url":"https://api.github.com/users/jjvbsag/received_events","type":"User","site_admin":false},"created_at":"2016-01-14T10:44:07Z","updated_at":"2016-01-14T10:44:07Z","body":"@pkulchenko Updated from master and can confirm, it works.\r\nthanks & regards"}}