DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T V

⟦3651f373f⟧ TextFile

    Length: 3608 (0xe18)
    Types: TextFile
    Names: »V«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile

with Calendar;
with Dollars_And_Cents;
package Checkbook is

-- This package defines transactions with a checkbook.
-- There are two kinds of transactions, deposits and checks.
-- The date and time of all transactions is automatically recorded
-- when each transaction is made.
-- All transactions have an amount (the number of dollars).
-- Check transactions also have an adreessee (the person to whome
-- the check is written) and the number of the check.
-- When a check is written it is automatically assigned the next
-- sequential check number.
--
-- The checkbook database can be archived and restored to/from a
-- file.  Normal usage is to retore the database from a file,
-- make transactions with the database, then archive the database
-- back into the file when finished.
--
-- This package also provides a mechanism to get a list of all
-- transactions from the database.  The user can then iterate
-- through the list and process each transaction.  Examples of
-- this might be printing a list of all deposits or totalling
-- all checks written in the month of may.

    type Database is private;

    -- Writes the current state of the checkbook database to a file.
    procedure Archive (The_Database : Database; To_File_Named : String);

    -- Restore the checkbook database from a file.
    procedure Restore (The_Database : out Database; From_File_Named : String);

    -- Make a deposit transaction to the checkbook database.
    procedure Deposit (Amount : Dollars_And_Cents.Dollars;  
                       To_Checkbook : Database);

    -- Write a check transaction from the checkbook database.
    procedure Write_Check (To_Addressee : String;  
                           Amount : Dollars_And_Cents.Dollars;
                           From_Checkbook : Database);

    type Transaction is private;

    type Transaction_Kind is (Check, Deposit);

    -- Returns the kind of the transaction.
    function Kind (Of_Transaction : Transaction) return Transaction_Kind;

    -- Returns the amount of the specified transaction.
    function Amount  
                (Of_Transaction : Transaction) return Dollars_And_Cents.Dollars;

    -- Returns the date of the specified transaction.
    function Date  
                (Of_Transaction : Transaction) return Calendar.Time;

    -- Returns the number of the specified check.
    -- Only check transactions have numbers.
    function Check_Number (Of_Check : Transaction) return Positive;

    -- Returns the addressee (person to whom the check is written)
    -- for the specified check.  Only checks have addressees.
    function Addressee (Of_Check : Transaction) return String;


    -- Iteration is provided to "iterate" though all transactions to
    -- process each one in turn.
    --
    -- Standard usage is:
    --
    --    while not No_More_transactions (transaction_Iterator) loop
    --        A_transaction := Current_transaction (transaction_Iterator);
    --        "Process" (A_transaction);
    --        Next_transaction (transaction_Iterator);
    --    end loop;

    type Transaction_Iterator is private;

    function Initialize (From_Database : Database) return Transaction_Iterator;

    function No_More_Transactions  
                (Iter : Transaction_Iterator) return Boolean;
    function Current_Transaction
                (Iter : Transaction_Iterator) return Transaction;
    procedure Next_Transaction  
                 (Iter : in out Transaction_Iterator);
private
    type Database is new Boolean;

    type Transaction is new Boolean;

    type Transaction_Iterator is new Boolean;

end Checkbook;