Another method of the class is called Lua

When I try to call a method of another class from another class, it will display an error message,

Attempt to call field'LoadShift' (a nil value)

This is my code,
loginpage1.lua

local LoadShift = nil;
.
.
function LoadShift()

end

loginpage2.lua

local loginObj = require("com.classess.loginpage1")
loginObj.LoadShift();

What’s wrong with my code, please help me solve this problem

make your custom class like this

--- ---------Your class LoadShift---------------
local LoadShift = {}
.
.
function LoadShift:LoadShiftFunc()
--do somthing
end
.
.
return LoadShift
----------- --------------------------

Then need it and call the function

---------------------

local LoadShift = require "LoadShift"
LoadShift:LoadShiftFunc()< /pre>

When I try to call a method of another class from another class, it displays an error message,

Attempt to call field'LoadShift' (a nil value)

This is my code,
loginpage1.lua

local LoadShift = nil;
.
.
function LoadShift()

end

loginpage2.lua

local loginObj = require("com.classess.loginpage1")
loginObj.LoadShift();

What’s wrong with my code, please help me solve this problem

Make your custom class like this

----------- -Your class LoadShift---------------
local LoadShift = {}
.
.
function LoadShift:LoadShiftFunc()
--do somthing
end
.
.
return LoadShift
------------------- ------------------

Then need it and call the function

---- -----------------

local LoadShift= require "LoadShift"
LoadShift:LoadShiftFunc()

< p>

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 3254 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.