Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,34 @@
-- simple construct
if logicalCondition then conditionWasTrue()
else conditionWasFalse()
-- multi-line is ok too
if logicalCondition
then
conditionWasTrue()
else
conditionWasFalse()
-- using block stuctures
if logicalCondition then do
conditionWasTrue()
...
end
else do
conditionWasFalse()
...
end
-- if/else if...
if logicalCondition1 then do
condition1WasTrue()
...
end
else if logicalCondition2 then do
condition2WasTrue()
...
end
else do
conditionsWereFalse()
...
end

View file

@ -0,0 +1,16 @@
-- simple construct
select
when logicalCondition1 then condition1()
when logicalCondition2 then condition2()
otherwise conditionDefault()
end
-- set up a catch block to intercept missing OTHERWISE clause
do
select
when logicalCondition1 then condition1()
when logicalCondition2 then condition2()
end
catch ex1 = NoOtherwiseException
ex1.printStackTrace()
end

View file

@ -0,0 +1,6 @@
-- simple construct
select case cc
when 'A' then say 'the case is A'
when 'B' then say 'the case is B'
otherwise say 'selection not recognized'
end

View file

@ -0,0 +1,4 @@
select
when cc == 'A' then ...
when cc == 'B' then ...
...

View file

@ -0,0 +1,20 @@
select label sl protect cc case cc
when 'A' then do
say 'the case is A'
if logicalCondition then leave sl -- just to use the lable
say '...'
end
when 'B' then do
say 'the case is B'
say '...'
end
otherwise
say 'selection not recognized'
say '...'
catch exs = RuntimeException
say 'Gronk!'
exs.printStackTrace()
finally
say 'selection done'
say 'TTFN'
end sl