FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
gnuplot/demo/break_continue.dem at master · gnuplot/gnuplot · GitHub
gnuplot
gnuplot
Repository navigation
Code
Pull requests
2
(2)
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
gnuplot
/
demo
/
break_continue.dem
Copy path
More file actions
More file actions
Latest commit
History
History
History
25 lines (22 loc) · 620 Bytes
Breadcrumbs
gnuplot
/
demo
/
break_continue.dem
Copy path
File metadata and controls
25 lines (22 loc) · 620 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#
# Unit test for `break` and `continue` commands
# Two different entry actions:
# "load break_continue.dem" executes the main loop
# "call break_continue.dem foo" executes the inner clause
#
if (ARGC == 0) {
do for [i=1:6] {
print "start ", i;
call 'break_continue.dem' sub1
if (i > 4) { print ">>> ERROR <<<" }
print "end ", i
}
print "done with for loop"
} else {
print " continue if i == 3, break if i > 4"
if (i > 4) { break; }
if (i == 3) { continue; print ">>> ERROR <<<" }
print " still in load file"
exit # exits only from this level of the call stack
print ">>> failed to exit <<<"
}
Back
|
FazBrowse Home
|
New Git URL