Editing
Flow-Diagrams
(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!
== 7. Inter-Program Call Sequence β Generate Run == '''What it shows:''' All CALL interactions between programs during a <code>generate</code> invocation, including the sieve loop, each divisor lookup, each prime insertion, and the shutdown sequence. <pre class="mermaid">sequenceDiagram participant OS as OS / Shell participant main as primesmain participant gen as primesgen participant dal as primes (DAL) participant ui as primesui participant db as PostgreSQL OS->>main: execute with arg "generate" main->>ui: CALL "primesui" ui-methods="start" ui-->>main: ui-method-result=0 / primes.prt opened main->>ui: CALL "primesui" ui-methods="log-message" "Primes generation starts." ui->>OS: DISPLAY on console main->>gen: CALL "primesgen" methods="generate" gen->>dal: CALL "primes" dal-methods="connect" dal->>db: EXEC SQL CONNECT TO primes db-->>dal: SQLCODE=0 dal-->>gen: dal-result=0 gen->>ui: LOG "Database initialisation succeeded." loop sieve: test-number 3 β 999,999,999 gen->>gen: DIVIDE test-number BY test-divider β test-rest alt test-rest = 0 (composite) gen->>gen: r82-next-test-number (test-number += 2, sqrt recalc) gen->>dal: CALL "primes" dal-methods="next-divider" dal->>db: SELECT prime WHERE ident = :new-ident db-->>dal: test-divider value dal-->>gen: dal-result=0 else test-divider > βtest-number (prime confirmed) gen->>ui: CALL "primesui" ui-methods="write" u-sequence, u-number ui->>ui: accumulate in 6-column buffer\nwrite line to primes.prt every 6 entries gen->>dal: CALL "primes" dal-methods="write" dal->>db: INSERT INTO primes (prime) VALUES (:prime) db-->>dal: SQLCODE=0 dal-->>gen: dal-result=0 gen->>gen: r82-next-test-number else otherwise (try next divisor) gen->>dal: CALL "primes" dal-methods="next-divider" dal->>db: SELECT prime WHERE ident = :new-ident db-->>dal: test-divider value dal-->>gen: dal-result=0 end end gen->>dal: CALL "primes" dal-methods="disconnect" dal->>db: EXEC SQL CONNECT RESET primes db-->>dal: SQLCODE=0 dal-->>gen: dal-result=0 gen-->>main: session-result=0 / EXIT PROGRAM main->>ui: CALL "primesui" ui-methods="log-message" "Primes run complete." main->>ui: CALL "primesui" ui-methods="stop" ui->>ui: flush partial line\nCLOSE primes.prt ui-->>main: ui-method-result=0 main->>OS: STOP RUN</pre> ----- <span id="inter-program-call-sequence-report-run"></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