DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

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

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦e1ae9a165⟧ Ada Source

    Length: 6144 (0x1800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, procedure Tree_Try, seg_04689f

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦5a81ac88f⟧ »Space Info Vol 1« 
        └─⟦this⟧ 

E3 Source Code



with Text_Io, Generic_Binary_Tree, Unbounded_String;

procedure Tree_Try is

    package My_String is new Unbounded_String (10);

    function Inferieur (C1, C2 : My_String.Variable_String) return Boolean;  
    function Are_Equal (C1, C2 : My_String.Variable_String) return Boolean;

    package My_Tree is new Generic_Binary_Tree
                              (My_String.Variable_String, Inferieur, Are_Equal);

    use My_Tree;
    Arbre : My_Tree.Object;
    Iterateur : My_Tree.Iterator;

    Objet : My_String.Variable_String;
    Ok : Boolean;

    function Inferieur (C1, C2 : My_String.Variable_String) return Boolean is
    begin
        return (My_String.Image (C1) < My_String.Image (C2));
    end Inferieur;

    function Are_Equal (C1, C2 : My_String.Variable_String) return Boolean is
    begin
        return (My_String.Image (C1) = My_String.Image (C2));
    end Are_Equal;

    procedure Ecrire (C : My_String.Variable_String) is
    begin
        Text_Io.Put (My_String.Image (C));
        Text_Io.New_Line;
    end Ecrire;

    procedure Inserer (Arbre : in out My_Tree.Object; S : String) is
    begin
        Insert (Arbre, My_String.Value (S));
    end Inserer;

begin
    Inserer (Arbre, "coucou");
    Inserer (Arbre, "manger");
    Inserer (Arbre, "fini");
    Inserer (Arbre, "toto");
    Inserer (Arbre, "tata");
    Inserer (Arbre, "titi");
    Inserer (Arbre, "tutu");
    Inserer (Arbre, "imagination");
    Inserer (Arbre, "voyage");
    Inserer (Arbre, "ski");
    Inserer (Arbre, "zozio");
    Inserer (Arbre, "schmilblick");
    Inserer (Arbre, "schmurtz");
    Inserer (Arbre, "hector");

    declare
    begin
        Next (Iterateur);
    exception
        when Iterator_Is_Not_Opened =>
            Text_Io.Put ("usage illicite de l'iterateur !");
            Text_Io.New_Line;
    end;

    Open (Iterateur, Arbre);
    while (At_End (Iterateur) /= True) loop
        Text_Io.Put ("la valeur courante est : ");
        Ecrire (Consult (Iterateur));
        Next (Iterateur);
    end loop;

    if Exists (Arbre, My_String.Value ("schmilblick")) then
        Text_Io.Put ("j'ai trouve shmilblick !");
        Text_Io.New_Line;
    end if;

    if Exists (Arbre, My_String.Value ("tutu")) then
        Text_Io.Put ("j'ai trouve tutu !");
        Text_Io.New_Line;
    end if;

    if Exists (Arbre, My_String.Value ("titi")) then
        Text_Io.Put ("j'ai trouve titi !");
        Text_Io.New_Line;
    end if;

    if not Exists (Arbre, My_String.Value ("turlututu")) then
        Text_Io.Put ("je n'ai pas trouve turlututu !");
        Text_Io.New_Line;
    end if;

    --  for I in 'a' .. 'z' loop
    --      Objet := I;
    --      Rechercher (Arbre, Objet, Ok);
    --      if (Ok = True) then
    --          Text_Io.Put (" j'ai trouve : " & Objet);
    --      else
    --          Text_Io.Put (" desole, je n'ai pas trouve : " & Objet);
    --      end if;
    --      Text_Io.New_Line;
    --  end loop;

end Tree_Try;


E3 Meta Data

    nblk1=5
    nid=0
    hdr6=a
        [0x00] rec0=20 rec1=00 rec2=01 rec3=00c
        [0x01] rec0=24 rec1=00 rec2=03 rec3=056
        [0x02] rec0=02 rec1=00 rec2=05 rec3=038
        [0x03] rec0=20 rec1=00 rec2=04 rec3=034
        [0x04] rec0=05 rec1=00 rec2=02 rec3=000
    tail 0x215433c6086515c5fc5b6 0x42a00088462060003