Control structures

Control structures are used to make decisions in code; they control the path of code based on a Boolean value. Lua provides the if statement for this purpose. An if statement is followed by a Boolean condition, which in turn is followed by a then/end chunk. The chunk is only executed when the Boolean condition evaluates to true.

The most basic syntax of an if statement is as follows:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.183.138