lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Is it possible to crunch these repeatable statements in Lua? with out the
rewrite "IF" statements etc.. maybe inside Array/Table checking etc

      if(xArg.exp==">") then
        if(what > number) then
          print(name,daysTotal)
        end
      end
      
      if(xArg.exp==">=") then
        if(what >= number) then
          print(name,daysTotal)
        end
      end
      
      if(xArg.exp=="<") then
        if(what < number) then
          print(name,daysTotal)
        end
      end
      
      if(xArg.exp=="<=") then
        if(what <= number) then
          print(name,daysTotal)
        end
      end
      
      if(xArg.exp=="=") then
        if(what == number) then
          print(name,daysTotal)
        end
      end