duckscript/examples/if_else.ds

66 lines
927 B
Plaintext
Raw Normal View History

2019-12-30 10:45:28 +00:00
if true
echo in if as value
2020-01-12 17:53:30 +00:00
end
2019-12-31 23:24:06 +00:00
if false
echo should not be here
2020-01-12 17:53:30 +00:00
end
2019-12-31 23:24:06 +00:00
if not false
echo in if as value with not condition
2020-01-12 17:53:30 +00:00
end
2019-12-31 23:24:06 +00:00
2019-12-30 10:45:28 +00:00
if set true
echo in if as command
2020-01-12 17:53:30 +00:00
end
2019-12-30 10:45:28 +00:00
if set false
echo should not be here
else
echo in else
2020-01-12 17:53:30 +00:00
end
2019-12-30 10:45:28 +00:00
if set false
echo should not be here
elseif set true
echo in else if
else
echo should not be here
2020-01-12 17:53:30 +00:00
end
2019-12-30 10:45:28 +00:00
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
2020-01-12 17:53:30 +00:00
end
2019-12-30 10:45:28 +00:00
else
echo should not be here
2020-01-12 17:53:30 +00:00
end
2020-01-01 19:46:47 +00:00
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
2020-01-03 14:11:23 +00:00
value = set "some text"
if starts_with ${value} "some"
2020-01-01 19:46:47 +00:00
echo after command
else
echo should not be here
2020-01-12 17:53:30 +00:00
end
end
2020-01-01 19:46:47 +00:00
else
echo should not be here
2020-01-12 17:53:30 +00:00
end