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

⟦b4dcab51a⟧ Ada Source

    Length: 5120 (0x1400)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Horaire_68, seg_051253

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 Util_String;

package body Horaire_68 is

    Sep_Heure_Minute : constant Character := ':';

    package Us renames Util_String;

    procedure Create (O : in out Object; Heure : Natural; Minute : Natural) is
    begin
        Set_Heure (O, Heure);
        Set_Minute (O, Minute);
    end Create;


    procedure Set_Heure (O : in out Object; Heure : Natural) is
    begin
        if Heure in T_Heure then
            O.Heure := Heure;
        else
            raise Code_Heure_Error;
        end if;
    end Set_Heure;


    procedure Set_Minute (O : in out Object; Minute : Natural) is
    begin
        if Minute in T_Minute then
            O.Minute := Minute;  
        else
            raise Code_Minute_Error;
        end if;
    end Set_Minute;


    function Get_Heure (O : Object) return T_Heure is
    begin
        return O.Heure;
    end Get_Heure;


    function Get_Minute (O : Object) return T_Minute is
    begin
        return O.Minute;
    end Get_Minute;


    function Image (O : Object) return String is
    begin
        return (Debut_Horaire &
                Us.Suppression_Espace_Left (Natural'Image (O.Heure)) &
                Sep_Heure_Minute &
                Us.Suppression_Espace_Left (Natural'Image (O.Minute)) &
                Sep_Horaire & Fin_Horaire);
    end Image;


    function Value (S : String) return Object is
        O : Object;
        Der_Car : Natural;
    begin  
        Value (S, O, Der_Car);
        return O;
    end Value;

    procedure Value (S : String; O : in out Object; Der_Car : in out Natural) is
        P1, P2, P3, P4 : Natural;
    begin  
        Us.String_Contient (S, Debut_Horaire, P1);
        Us.Position (S (P1 + 1 .. S'Last), Sep_Heure_Minute, P2);
        Us.Position (S (P2 + 1 .. S'Last), Sep_Horaire, P3);
        Us.String_Contient (S (P3 + 1 .. S'Last), Fin_Horaire, P4);

        Set_Heure (O, Natural'Value (S (P1 + 1 .. P2 - 1)));
        Set_Minute (O, Natural'Value (S (P2 + 1 .. P3 - 1)));

        Der_Car := P4;
    end Value;

    function Superieur (O1 : Object; O2 : Object) return Boolean is
    begin
        if Get_Heure (O1) < Get_Heure (O2) then
            return False;
        elsif Get_Heure (O1) = Get_Heure (O2) then
            return (Get_Minute (O1) > Get_Minute (O2));
        else
            return True;
        end if;

    end Superieur;

    function Egal (O1 : Object; O2 : Object) return Boolean is
    begin
        return ((Get_Heure (O1) = Get_Heure (O2)) and
                (Get_Minute (O1) = Get_Minute (O2)));
    end Egal;


end Horaire_68;

E3 Meta Data

    nblk1=4
    nid=2
    hdr6=6
        [0x00] rec0=2c rec1=00 rec2=01 rec3=00a
        [0x01] rec0=1f rec1=00 rec2=03 rec3=034
        [0x02] rec0=1a rec1=00 rec2=04 rec3=000
        [0x03] rec0=04 rec1=9c rec2=15 rec3=542
    tail 0x2154b2a4287995b215cdf 0x42a00088462060003
Free Block Chain:
  0x2: 0000  00 00 00 04 80 01 65 01 28 4f 31 29 20 3d 20 47  ┆      e (O1) = G┆