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

⟦bb3756c44⟧ TextFile

    Length: 5754 (0x167a)
    Types: TextFile
    Names: »B«

Derivation

└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13
    └─ ⟦124ff5788⟧ »DATA« 
        └─⟦this⟧ 
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
    └─ ⟦6f12a12be⟧ »DATA« 
        └─⟦this⟧ 
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─ ⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

package body Dyn is

    package My_Integer_Io is new Integer_Io (Integer);

    package My_Float_Io is new Float_Io (Float);

    function "&" (Ds1, Ds2 : Dyn_String) return Dyn_String is
        Ds3 : Dyn_String;
    begin
        Ds3 := new String_Contents (Ds1.Size + Ds2.Size);
        Ds3.Data (1 .. Ds3.Size) :=
           Ds1.Data (1 .. Ds1.Size) & Ds2.Data (1 .. Ds2.Size);
        return Ds3;
    end "&";

    function D_String (Char : Character) return Dyn_String is
        Ds : Dyn_String;
    begin
        Ds := new String_Contents (Size => 1);
        Ds.Data (1) := Char;
        return Ds;
    end D_String;

    function D_String (Str : String) return Dyn_String is
        Ds : Dyn_String;
    begin
        Ds := new String_Contents (Size => Str'Length);
        Ds.Data (1 .. Ds.Size) := Str;
        return Ds;
    end D_String;

    function D_String (Int : in Integer) return Dyn_String is
        Ds : Dyn_String;
    begin
        Ds := D_String (Integer'Image (Int));
        return Ds;
    end D_String;

    function Char (Dstr : Dyn_String) return Character is
    begin
        return Dstr.Data (1);
    end Char;

    function Str (Dstr : Dyn_String) return String is
    begin
        return Dstr.Data (1 .. Dstr.Size);
    end Str;

    function Int (Dstr : Dyn_String) return Integer is
        V : Integer;
        L : Positive;
    begin
        My_Integer_Io.Get (Str (Dstr), V, L);
        return V;
    end Int;

    function Flt (Dstr : Dyn_String) return Float is
        V : Float;
        L : Positive;
    begin
        My_Float_Io.Get (Str (Dstr), V, L);
        return V;
    end Flt;

    function Length (Dstr : Dyn_String) return Natural is
    begin
        return Dstr.Size;
    end Length;

    function "<" (Ds1, Ds2 : Dyn_String) return Boolean is
    begin
        if Str (Ds1) < Str (Ds2) then
            return (True);
        else
            return (False);
        end if;
    end "<";

    function Substring
                (Dstr : Dyn_String; Start : Natural; Length : Natural := 0)
                return Dyn_String is
        Ds : Dyn_String;
        L : Natural := Length;
    begin
        if (Start < 1) or (Start > Dstr.Size) then
            raise Constraint_Error;
        else
            if L = 0 then
                L := Dstr.Size - Start + 1;
            end if;
            if Dstr.Size < Start + L - 1 then
                raise String_Too_Short;
            else
                Ds := new String_Contents (L);
                Ds.Data (1 .. L) := Dstr.Data (Start .. Start + L - 1);
                return Ds;
            end if;
        end if;
    end Substring;

    function Index (Source_String, Pattern_String : Dyn_String;
                    Start_Pos : Integer) return Integer is
        No_Match : Integer := 0;
        No_Fit : Integer := -1;
    begin
        if Source_String.Size < Pattern_String.Size + Start_Pos - 1 or
           Start_Pos < 1 then
            return No_Fit;
        end if;
        for I in Start_Pos .. Source_String.Size - Pattern_String.Size + 1 loop
            if Source_String.Data (I .. I + Pattern_String.Size - 1) =
               Pattern_String.Data (1 .. Pattern_String.Size) then
                return I;
            end if;
        end loop;
        return No_Match;
    end Index;

    function Rindex (Source_String, Pattern_String : Dyn_String;
                     Start_Pos : Integer) return Integer is
        No_Match : Integer := 0;
        No_Fit : Integer := -1;
    begin
        if Source_String.Size < Pattern_String.Size + Start_Pos - 1 or
           Start_Pos < 1 then
            return No_Fit;
        end if;
        for I in reverse 1 .. Start_Pos loop
            if Source_String.Data (I .. I + Pattern_String.Size - 1) =
               Pattern_String.Data (1 .. Pattern_String.Size) then
                return I;
            end if;
        end loop;
        return No_Match;
    end Rindex;

    function Upper_Case (Strg : in Dyn.Dyn_String) return String is
        Answer : String (1 .. Length (Strg));
    begin
        Answer := Str (Strg);
        for I in 1 .. Length (Strg) loop
            if (Answer (I) >= 'a') and (Answer (I) <= 'z') then
                Answer (I) := Character'Val
                                 (Character'Pos (Answer (I)) -
                                  Character'Pos ('a') + Character'Pos ('A'));
            end if;
        end loop;
        return Answer;
    end Upper_Case;

    procedure Get_Line (Filename : in Text_Io.File_Type;
                        Item : out Dyn.Dyn_String;
                        Last : out Natural) is

        Static_String_Var : String (1 .. 255);
        Lastchar : Natural;

    begin
        Text_Io.Get_Line (Filename, Static_String_Var, Lastchar);
        Item := Dyn.Substring (Dyn.D_String (Static_String_Var), 1, Lastchar);
        Last := Lastchar;
    end Get_Line;


    procedure Get_Line (Item : out Dyn.Dyn_String; Last : out Natural) is

        Static_String_Var : String (1 .. 255);
        Lastchar : Natural;

    begin
        Text_Io.Get_Line (Static_String_Var, Lastchar);
        Item := Dyn.Substring (Dyn.D_String (Static_String_Var), 1, Lastchar);
        Last := Lastchar;
    end Get_Line;

    procedure Put (Filename : in Text_Io.File_Type; Item : in Dyn.Dyn_String) is

    begin
        Put (Filename, Str (Item));
    end Put;

    procedure Put (Item : in Dyn.Dyn_String) is

    begin
        Put (Str (Item));
    end Put;

    procedure Open (Filename : in out Text_Io.File_Type;
                    Mode : in Text_Io.File_Mode;
                    Filenm : in Dyn_String) is
    begin
        Text_Io.Open (Filename, Mode, Str (Filenm));
    end Open;

end Dyn;




--
-- EXPERT SYSTEM
--