Editing
Control flow
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== 3. primesgen β Paragraph Map == <pre>PROCEDURE DIVISION USING primes-session β βββ EVALUATE TRUE on methods WHEN report-primes β PERFORM r90-start-primes-report βββββββββββββββββββΊ r90-start-primes-report β β β CALL primes "connect" β β β CALL primes "cursor" β β β PERFORM r94-fetch βββΊ r94-fetch β β β β CALL primes "next-prime" β β β βββ return β β βββ return β β β IF session-method-ok β PERFORM r86-report-primes UNTIL session-method-eof β β ββββββββββββββββββββββββββββββββββββββββββββββββΊ r86-report-primes (loop body) β β β CALL primesui "write" β β β PERFORM r94-fetch βββββββββββββββββββββββββββΊ r94-fetch β β β β CALL primes "next-prime" β β β βββ return β β βββ (loop back) β WHEN generate-primes β PERFORM r91-start-primes-generation βββββββββββββββΊ r91-start-primes-generation β β β CALL primes "connect" β β βββ return β β β IF session-method-ok β PERFORM r80-test-number UNTIL test-number = 999999999 β β ββββββββββββββββββββββββββββββββββββββββββββββββΊ r80-test-number (loop body) β β β DIVIDE test-number BY test-divider β test-rest β β β EVALUATE TRUE β β β WHEN test-rest = 0 β β β PERFORM r82-next-test-number βββββββββββΊ r82-next-test-number β β β β ADD 2 TO test-number β β β β COMPUTE sqrt β β β β MOVE 1 TO old-ident β β β β PERFORM r89-get-next-divider βββΊ r89-get-next-divider β β β β β CALL primes "get" β β β β βββ return β β β βββ return β β β WHEN test-divider > test-number-sqr β β β PERFORM r85-write-prime ββββββββββββββΊ r85-write-prime β β β β β CALL primes "write" β β β β β CALL primesui "write" β β β β βββ return β β β PERFORM r82-next-test-number (as above) β β β WHEN OTHER β β β PERFORM r89-get-next-divider (as above) β β βββ (loop back) β WHEN OTHER LOG "Bad method" β βββ PERFORM r99-close-primes βββββββββββββββββββββββββββββΊ r99-close-primes β β CALL primes "disconnect" β βββ return EXIT PROGRAM</pre> '''Loop summary β primesgen:''' {| !width="25%"| Loop !width="25%"| Type !width="25%"| Condition !width="25%"| Paragraph |- | Report read | PERFORM UNTIL | <code>session-method-eof</code> (result = 9) | r86-report-primes |- | Sieve | PERFORM UNTIL | <code>test-number = 999999999</code> | r80-test-number |- | Inner (test-number) | EVALUATE inside PERFORM | drives calls to r82 / r85 / r89 | r80-test-number |} ----- <span id="primes-dal-paragraph-map"></span>
Summary:
Please note that all contributions to Webhuis wiki are considered to be released under the GNU Free Documentation License 1.3 or later (see
Project:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Voorpagina
Cobol and PostgreSQL
PostgreSQL
CFEngine
Proxmox
Webhuis Kennisbank
Basale infra
Webhuis bouwstenen
Webhuis configuratie
Webhuis Infra
Webhuis Support
Webhuis Raspberry
Opzet Applicaties
Business Applicaties
Community portal
Current events
Recent changes
Random page
Help
sitesupport
Tools
What links here
Related changes
Special pages
Page information