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 - download
Index: ┃ B T

⟦b70452781⟧ TextFile

    Length: 2206 (0x89e)
    Types: TextFile
    Names: »B«

Derivation

└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Class_Integer;
with Class_Boolean;
with Class_String;
with Class_Block;
with Class_Pen;
with Class_Turtle;
with Class_Window;
with Text_Io;

package body Old_Class_Printer is

    type Flag is (Off, On);

    Tab_Flag : Flag := On;

    procedure Create is
    begin
        Position := 0;
        Tab_Flag := On;
    end Create;

    procedure Forward (Number : in Integer) is
    begin
        if Number > 0 then
            Position := Position + Number;
        end if;
    end Forward;

    procedure Backward (Number : in Integer) is
    begin
        if Number > 0 then
            Position := Position - Number;
        end if;
        if Position < 0 then
            Position := 0;
        end if;
    end Backward;

    procedure New_Line (Number : Integer := 1) is
    begin
        for I in 1 .. Number loop
            Text_Io.New_Line;
        end loop;
        Tab_Flag := On;
    end New_Line;

    procedure Put (The_String : String) is
    begin
        if Tab_Flag = On then
            Put_Tab (The_String);
        else
            Text_Io.Put (The_String);
        end if;
        Tab_Flag := Off;
    end Put;

    procedure Put_Tab (The_String : String) is
        Tabulation : String (1 .. Position) := (1 .. Position => ' ');
    begin
        Text_Io.Put (Tabulation & The_String);
        Tab_Flag := Off;
    end Put_Tab;

    procedure Put (This_Object : Object.Reference) is
    begin
        case Object.Get (Class_From => This_Object) is
            when Object.Integer_Class =>
                Class_Integer.Put (This_Object);
            when Object.Boolean_Class =>
                Class_Boolean.Put (This_Object);
            when Object.String_Class =>
                Class_String.Put (This_Object);
            when Object.Turtle_Class =>
                Class_Turtle.Put (This_Object);
            when Object.Pen_Class =>
                Class_Pen.Put (This_Object);
            when Object.Block_Class =>
                Class_Block.Put (This_Object);
            when Object.Window_Class =>
                Class_Window.Put (This_Object);
            when Object.Void_Class =>
                null;
        end case;  
    end Put;

end Old_Class_Printer;