@Idurniat
Yes, it is valid and in accordance with the documentation guidelines, as far as I know. I do get a warning (and hence this post) but there are no errors, and my app functions without any problems.
@sdktester15
Here is my code
Config.lua
local d = require("data") local aspectRatio = display.pixelHeight/display.pixelWidth local h, class if (aspectRatio \< 1.34) then -- iPad h = 426 d.setClass("A") elseif (aspectRatio \< 1.61) then -- Kindle Fire HD h = 512 d.setClass("B") elseif (aspectRatio \< 1.67) then -- Nexus One, Nokia Lumina h = 533 d.setClass("C") elseif (aspectRatio \< 1.71) then -- Kindle Fire, Samsung Galaxy Tab h = 546 d.setClass("D") else -- iPhone, Samsung Galaxy, Amazon Fire, Ouya, etc. h = 568 d.setClass("E") end application = { content = { width = 320, height = h, scale = "zoomEven", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 1.5, ["@3x"] = 2.5, ["@4x"] = 3.5 }, fps = d.fps, }, }
Data.lua
local D = {} D.fps = 30 function D.setClass(class) D.class = class end --[[some other irrelevant code --]] return D
First of all, it’s a warning not an error. We are now examining both config.lua and build.settings to make sure they contain valid code. This catches mistakes like:
FacebookAppID vs. FacebookAppId.
Our scanner can’t really spend the time parsing the file you’re requiring and yes, your config.lua is too complex for our parser. The net effect is you get the warning and you don’t get any problems we might flag while trying to help you make sure that part of your code is right.
As I mentioned earlier in the post, I’m aware it’s a warning and not an error. And no, I don’t encounter any problems while running my code. It works just fine as per the previous build.
I do appreciate the scanner “looking out for me” in case of potential errors, but I am positive there are none (if there was an error, I would have encountered it by now).
The thing is, it bothers me that, every time I launch the Corona simulator, I get a warning message. (I am warned. I do not need to be warned 1000 times.)
@Idurniat
Yes, it is valid and in accordance with the documentation guidelines, as far as I know. I do get a warning (and hence this post) but there are no errors, and my app functions without any problems.
@sdktester15
Here is my code
Config.lua
local d = require("data") local aspectRatio = display.pixelHeight/display.pixelWidth local h, class if (aspectRatio \< 1.34) then -- iPad h = 426 d.setClass("A") elseif (aspectRatio \< 1.61) then -- Kindle Fire HD h = 512 d.setClass("B") elseif (aspectRatio \< 1.67) then -- Nexus One, Nokia Lumina h = 533 d.setClass("C") elseif (aspectRatio \< 1.71) then -- Kindle Fire, Samsung Galaxy Tab h = 546 d.setClass("D") else -- iPhone, Samsung Galaxy, Amazon Fire, Ouya, etc. h = 568 d.setClass("E") end application = { content = { width = 320, height = h, scale = "zoomEven", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 1.5, ["@3x"] = 2.5, ["@4x"] = 3.5 }, fps = d.fps, }, }
Data.lua
local D = {} D.fps = 30 function D.setClass(class) D.class = class end --[[some other irrelevant code --]] return D
First of all, it’s a warning not an error. We are now examining both config.lua and build.settings to make sure they contain valid code. This catches mistakes like:
FacebookAppID vs. FacebookAppId.
Our scanner can’t really spend the time parsing the file you’re requiring and yes, your config.lua is too complex for our parser. The net effect is you get the warning and you don’t get any problems we might flag while trying to help you make sure that part of your code is right.
As I mentioned earlier in the post, I’m aware it’s a warning and not an error. And no, I don’t encounter any problems while running my code. It works just fine as per the previous build.
I do appreciate the scanner “looking out for me” in case of potential errors, but I am positive there are none (if there was an error, I would have encountered it by now).
The thing is, it bothers me that, every time I launch the Corona simulator, I get a warning message. (I am warned. I do not need to be warned 1000 times.)