Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,3 +0,0 @@
|
|||
<<Top>>
|
||||
Put_Line("Hello, World");
|
||||
goto Top;
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
Outer:
|
||||
loop
|
||||
-- do something
|
||||
loop
|
||||
if Finished then
|
||||
exit Outer; -- exits both the inner and outer loops
|
||||
end if;
|
||||
-- do something else
|
||||
end loop;
|
||||
end loop Outer;
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
Outer:
|
||||
loop
|
||||
-- do something
|
||||
loop
|
||||
exit Outer when Finished;
|
||||
-- do something else
|
||||
end loop;
|
||||
end loop Outer;
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
procedure Foo is
|
||||
begin
|
||||
-- do something
|
||||
if Nothing_More_To_Do then
|
||||
return;
|
||||
end if;
|
||||
-- do more
|
||||
end Foo;
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
select
|
||||
delay 10.0;
|
||||
Put_Line ("Cannot finish this in 10s");
|
||||
then abort
|
||||
-- do some lengthy calculation
|
||||
...
|
||||
end select;
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
PROGRAM-ID. Go-To-Example.
|
||||
|
||||
PROCEDURE DIVISION.
|
||||
Foo.
|
||||
DISPLAY "Just a reminder: GO TOs are evil."
|
||||
|
||||
GO TO Foo
|
||||
.
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
GO TO First-Thing Second-Thing Third-Thing
|
||||
DEPENDING ON Thing-To-Do
|
||||
|
||||
* *> Handle invalid thing...
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
EVALUATE Thing-To-Do
|
||||
WHEN 1
|
||||
* *> Do first thing...
|
||||
|
||||
WHEN 2
|
||||
* *> Do second thing...
|
||||
|
||||
WHEN 3
|
||||
* *> Do third thing...
|
||||
|
||||
WHEN OTHER
|
||||
* *> Handle invalid thing...
|
||||
END-EVALUATE
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
identification division.
|
||||
program-id. altering.
|
||||
|
||||
procedure division.
|
||||
main section.
|
||||
|
||||
*> And now for some altering.
|
||||
contrived.
|
||||
ALTER story TO PROCEED TO beginning
|
||||
GO TO story
|
||||
.
|
||||
|
||||
*> Jump to a part of the story
|
||||
story.
|
||||
GO.
|
||||
.
|
||||
|
||||
*> the first part
|
||||
beginning.
|
||||
ALTER story TO PROCEED to middle
|
||||
DISPLAY "This is the start of a changing story"
|
||||
GO TO story
|
||||
.
|
||||
|
||||
*> the middle bit
|
||||
middle.
|
||||
ALTER story TO PROCEED to ending
|
||||
DISPLAY "The story progresses"
|
||||
GO TO story
|
||||
.
|
||||
|
||||
*> the climatic finish
|
||||
ending.
|
||||
DISPLAY "The story ends, happily ever after"
|
||||
.
|
||||
|
||||
*> fall through to the exit
|
||||
exit program.
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
PROGRAM-ID. Perform-Example.
|
||||
|
||||
PROCEDURE DIVISION.
|
||||
Main.
|
||||
PERFORM Moo
|
||||
PERFORM Display-Stuff
|
||||
PERFORM Boo THRU Moo
|
||||
|
||||
GOBACK
|
||||
.
|
||||
|
||||
Display-Stuff SECTION.
|
||||
Foo.
|
||||
DISPLAY "Foo " WITH NO ADVANCING
|
||||
.
|
||||
|
||||
Boo.
|
||||
DISPLAY "Boo " WITH NO ADVANCING
|
||||
.
|
||||
|
||||
Moo.
|
||||
DISPLAY "Moo"
|
||||
.
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
REBOL [
|
||||
Title: "Flow Control"
|
||||
URL: http://rosettacode.org/wiki/Flow_Control_Structures
|
||||
]
|
||||
|
||||
; return -- Return early from function (normally, functions return
|
||||
; result of last evaluation).
|
||||
|
||||
hatefive: func [
|
||||
"Prints value unless it's the number 5."
|
||||
value "Value to print."
|
||||
][
|
||||
if value = 5 [return "I hate five!"]
|
||||
print value
|
||||
]
|
||||
|
||||
print "Function hatefive, with various values:"
|
||||
hatefive 99
|
||||
hatefive 13
|
||||
hatefive 5
|
||||
hatefive 3
|
||||
|
||||
; break -- Break out of current loop.
|
||||
|
||||
print [crlf "Loop to 10, but break out at five:"]
|
||||
repeat i 10 [
|
||||
if i = 5 [break]
|
||||
print i
|
||||
]
|
||||
|
||||
; catch/throw -- throw breaks out of a code block to enclosing catch.
|
||||
|
||||
print [crlf "Start to print two lines, but throw out after the first:"]
|
||||
catch [
|
||||
print "First"
|
||||
throw "I'm done!"
|
||||
print "Second"
|
||||
]
|
||||
|
||||
; Using named catch blocks, you can select which catcher you want when throwing.
|
||||
|
||||
print [crlf "Throw from inner code block, caught by outer:"]
|
||||
catch/name [
|
||||
print "Outer catch block."
|
||||
catch/name [
|
||||
print "Inner catch block."
|
||||
throw/name "I'm done!" 'Johnson
|
||||
print "We never get here."
|
||||
] 'Clemens
|
||||
print "We never get here, either."
|
||||
] 'Johnson
|
||||
|
||||
; try
|
||||
|
||||
div: func [
|
||||
"Divide first number by second."
|
||||
a b
|
||||
/local r "Result"
|
||||
][
|
||||
if error? try [r: a / b] [r: "Error!"]
|
||||
r ; Functions return last value evaluated.
|
||||
]
|
||||
|
||||
print [crlf "Report error on bad division:"]
|
||||
print div 10 4
|
||||
print div 10 2
|
||||
print div 10 1
|
||||
print div 10 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue