local bOK = false ;

--bool 类型判断
if bOK then 
    print('is ok');
else
    print('is not ok');
end 

local sName = 'Eric';
if sName ~= 'Eric' then   --相当于不等于
    print('is not Eric');
else
    print('is Eric');
end

--多条件判断
if sName == 'check_user' then    --检查用户
    print('check_user');
elseif sCmd == 'has_right' then  --检查用户权限
    print('has_right');
elseif sCmd == 'check_user_by_empno' then  --检查用户通过工号
    print('check_user_by_empno');
elseif sCmd == 'check_eqpt' then  --检查设备是否有效
    print('check_eqpt');
else
    print('unknow');    
end
Copyright © TouchNet 2015 all right reserved,powered by Gitbook最后修订时间: 2022-06-21 09:21:04

results matching ""

    No results matching ""