LUA逻辑运算符OR的使用

来源:互联网 发布:怎么知道我的网络 编辑:程序博客网 时间:2024/05/22 02:01
function CheckValue(str_value, int_value)local msg;--逻辑运算符的使用if (int_value < 0) or (str_value == ' ')  thenmsg = 0;elsemsg = 1;endreturn msg;endin_str = io.read();in_int = 1;status = CheckValue(in_str, in_int);if status == 1 thenprint("all input");elseprint("has error");end

  

原创粉丝点击