Like in python we are having pass statement.
def calcu(): pass
in Lua is there any statment like this ? i want to do
if connect then pass
Python pass StatementThe pass statement is used as a placeholder for future code. When the pass statement is executed, nothing happens, but you avoid getting an error when empty code is not allowed.
pass is a special statement in Python that does nothing. It only works as a dummy statement. We can use pass in empty while statement also. We can use pass in empty if else statements.
The pass statement in Python is used when a statement is required syntactically but you do not want any command or code to execute. It is like null operation, as nothing will happen is it is executed. Pass statement can also be used for writing empty loops.
pass
in Python does nothing. In Lua, you can just leave it empty:
if connect then end
If you want a placeholder, use an empty block
if connect then do end end
or if in Lua 5.2, use a semicolon:
if connect then ; end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With