Hello
im new to corona, but trying to do something) i can figure, what is a difference between “if” and “elseif” inside a function? [import]uid: 16142 topic_id: 11111 reply_id: 311111[/import]
if is the beginning of an if statement.
elseif can only be used after an if (like an else, but with a condition of its own).
Example:
if condition then
--only executes if condition is true
else
--only executes if condition is false
end
if condition then
--only executes if condition is true
elseif condition2 then
--only executes if condition is false and condition2 is true
end
[import]uid: 49205 topic_id: 11111 reply_id: 40366[/import]
thanks a lot
can i ask another silly question?
can i make a function in a first lines of code and then somehow use it in another function? How to do so?
I think about function of text displaying, i wrote it now and then i touch something i need this function to work… [import]uid: 16142 topic_id: 11111 reply_id: 40367[/import]
Just call the function name like you normally would.
[code]
function callMe()
end
function randomFunction()
callMe()
end
[/code] [import]uid: 49205 topic_id: 11111 reply_id: 40381[/import]