Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
FLOW-MATIC
(section)
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!
== Sample Code == A sample FLOW-MATIC program:<ref>Sperry Rand (1957) p. 7.</ref><ref>Sammet (1969) p. 323.</ref> <!-- Note to editors: Blanks are sign[[If statement|IF]]icant, including before punctuation, although they are not clearly indicated in the marketing brochure. Barring transcription errors, this sample is now correct, so please do not 'fix' it unless you are absolutely sure you know what you're doing. --> ({{vanchor|0}}) INPUT INVENTORY FILE-A PRICE FILE-B ; OUTPUT PRICED-INV FILE-C UNPRICED-INV FILE-D ; HSP D . ({{vanchor|1}}) COMPARE PRODUCT-NO (A) WITH PRODUCT-NO (B) ; IF GREATER GO TO OPERATION 10 ; IF EQUAL GO TO OPERATION 5 ; OTHERWISE GO TO OPERATION 2 . ({{vanchor|2}}) TRANSFER A TO D . ({{vanchor|3}}) WRITE-ITEM D . ({{vanchor|4}}) JUMP TO OPERATION 8 . ({{vanchor|5}}) TRANSFER A TO C . ({{vanchor|6}}) MOVE UNIT-PRICE (B) TO UNIT-PRICE (C) . ({{vanchor|7}}) WRITE-ITEM C . ({{vanchor|8}}) READ-ITEM A ; IF END OF DATA GO TO OPERATION 14 . ({{vanchor|9}}) JUMP TO OPERATION 1 . ({{vanchor|10}}) READ-ITEM B ; IF END OF DATA GO TO OPERATION 12 . ({{vanchor|11}}) JUMP TO OPERATION 1 . ({{vanchor|12}}) SET OPERATION 9 TO GO TO OPERATION 2 . ({{vanchor|13}}) JUMP TO OPERATION 2 . ({{vanchor|14}}) TEST PRODUCT-NO (B) AGAINST ; IF EQUAL GO TO OPERATION 16 ; OTHERWISE GO TO OPERATION 15 . ({{vanchor|15}}) REWIND B . ({{vanchor|16}}) CLOSE-OUT FILES C ; D . ({{vanchor|17}}) STOP . (END) Sample Notes # Note that this sample includes only the executable statements of the program, the {{code|COMPILER}} section. The record fields {{code|PRODUCT-NO}} and {{code|UNIT-PRICE}} would have been defined in the {{code|DIRECTORY}} section, which ([[FLOW-MATIC#Innovations and influence|as previously noted]]) did not use English-like syntax.<ref>Hopper (1978) p. 18.</ref> # Files are referred to by the letter at the end of the FILE-LETTER. Example: FILE-A is referred to later just by A and is for ease of reference in following code. # Operations are numbered in an unbroken sequence from 0..n and are performed in that order unless a statement to the contrary is reached/made (executed) (JUMP, etc.). # The highest numbered operation is the one that stops the program. # A much more detailed overview of FLOW-MATIC is available in the manual titled, FLOW-MATIC PROGRAMMING SYSTEM<ref>Remington Rand Univac a Division of Sperry Rand Corporation (1957). FLOW-MATIC PROGRAMMING SYSTEM</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)