4.13. Lua process control

发布时间 : 2025-10-25 13:34:08 UTC      

Page Views: 10 views

Lua programming language flow control statements are set by the program to set one or more conditional statements. When the condition is true executes the specified program code when the condition is false executes other specified code.

The following is a typical flow chart of process control:

Image0

The conditional expression result of the control structure can be any value Lua believes that false and nil are false, true and non nil is true.

It should be noted that 0 in Lua is true :

4.13.1. Example #

--[ 0 is true ] if(0) then print("0 is true") end 

The output of the above code is:

0 is true 

Lua provides the following control structure statements:

Statement

Description

If statement

If statement? It consists of a Boolean expression as a conditional judgment,followed by other statements.

If…else statement

If statement? Can you communicate with? Use else statement in combination, Execute the else statement code when the if conditional expression is false.

If nested statement

Can you do it in if? Or? use one or more if in else if? Or else if? Statement.

《地理信息系统原理、技术与方法》  97

最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。