duckscript/examples/if_else.ds
sagie gur ari 59099255e4 docs
2020-01-03 14:11:23 +00:00

66 lines
960 B
Plaintext

if true
echo in if as value
end_if
if false
echo should not be here
end_if
if not false
echo in if as value with not condition
end_if
if set true
echo in if as command
end_if
if set false
echo should not be here
else
echo in else
end_if
if set false
echo should not be here
elseif set true
echo in else if
else
echo should not be here
end_if
if set false
echo should not be here
elseif set true
echo in else if but not done yet
if set true
echo nested if
end_if
else
echo should not be here
end_if
value = set false
if ${value}
echo should not be here
elseif true
echo in else if but not done yet
value = set true
if not false
echo nested if
value = set "some text"
if starts_with ${value} "some"
echo after command
else
echo should not be here
end_if
end_if
else
echo should not be here
end_if