oracle if 嵌套语句吗,Lua嵌套if语句
在Lua編程中嵌套if-else語句是合法的,這意味著在一個if或else if語句中可以使用另一個if或else if語句。
語法
嵌套if語句的語法如下 -
if( boolean_expression 1)
then
--[ Executes when the boolean expression 1 is true --]
if(boolean_expression 2)
then
--[ Executes when the boolean expression 2 is true --]
end
end
使用與嵌套if語句類似的方式嵌套if else語句。
示例
--[ local variable definition --]
a = 100;
b = 200;
--[ check the boolean condition --]
if( a == 100 )
then
--[ if condition is true then check the following --]
if( b == 200 )
then
--[ if condition is true then print the following --]
print("Value of a is 100 and b is 200" );
end
end
print("Exact value of a is :", a );
print("Exact value of b is :", b );
構(gòu)建并運行上面的代碼時,會產(chǎn)生以下結(jié)果 -
Value of a is 100 and b is 200
Exact value of a is : 100
Exact value of b is : 200
¥ 我要打賞
糾錯/補充
收藏
加QQ群啦,易百教程官方技術(shù)學(xué)習(xí)群
注意:建議每個人選自己的技術(shù)方向加群,同一個QQ最多限加 3 個群。
總結(jié)
以上是生活随笔為你收集整理的oracle if 嵌套语句吗,Lua嵌套if语句的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 黑征信有办法恢复白户吗
- 下一篇: oracle中dlink使用,Oracl