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

⟦3031208e3⟧ Ada Source

    Length: 6144 (0x1800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Convert, seg_038a0c, separate Lex

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 String_Utilities;
separate (Lex)
package body Convert is

    function From_Int_To_Natural (S : String) return Natural is
        Ok : Boolean := True;
        Target : Integer := 0;
    begin
        String_Utilities.String_To_Number (S, Target, Ok);
        if Ok then
            return Natural (Target);
        else
            return 0;
        end if;
    end From_Int_To_Natural;


    function From_Based_To_Natural (S : String) return Natural is  
        S_Base : constant String := String (S (2 .. 3));
        I_Base : Integer := 0;
        N_Base : Natural := 0;
        Source : constant String := String (S (5 .. S'Last));
        Ok : Boolean := True;
        Target : Integer := 0;
    begin  
        String_Utilities.String_To_Number (S_Base, I_Base, Ok);
        if Ok then
            N_Base := Natural (I_Base);
            String_Utilities.String_To_Number (Source, Target, Ok, N_Base);
            if Ok then
                return Natural (Target);
            else
                return 0;
            end if;
        else
            return 0;
        end if;
    end From_Based_To_Natural;


    function From_Hour_To_Natural (S : String) return Natural is
        Time : constant String := String (S);
        Source : String (1 .. 10);
        Source_Length : Natural := 0;
        Value : Natural := 0;
        Target : Natural := 0;
        Ok : Boolean := True;
        Coef : Natural := 10;
    begin
        for I in 1 .. Time'Last loop
            case Time (I) is
                when 'h' | 'H' =>
                    String_Utilities.String_To_Number
                       (Source (1 .. Source_Length), Target, Ok);
                    if Ok then
                        Value := Value + Target * 36000;
                    end if;
                    Source_Length := 0;
                when 'm' | 'M' =>
                    String_Utilities.String_To_Number
                       (Source (1 .. Source_Length), Target, Ok);
                    if Ok then
                        Value := Value + Target * 600;
                    end if;
                    Source_Length := 0;
                when 's' | 'S' =>
                    String_Utilities.String_To_Number
                       (Source (1 .. Source_Length), Target, Ok);
                    if Ok then
                        Value := Value + Target * Coef;
                    end if;
                    Source_Length := 0;
                when '.' =>
                    Coef := 1;
                when others =>
                    Source_Length := Source_Length + 1;
                    Source (Source_Length) := Time (I);
            end case;
        end loop;
        return Value;
    end From_Hour_To_Natural;
end Convert;

E3 Meta Data

    nblk1=5
    nid=3
    hdr6=6
        [0x00] rec0=20 rec1=00 rec2=01 rec3=01e
        [0x01] rec0=1e rec1=00 rec2=02 rec3=00a
        [0x02] rec0=16 rec1=00 rec2=05 rec3=000
        [0x03] rec0=06 rec1=00 rec2=03 rec3=000
        [0x04] rec0=80 rec1=00 rec2=00 rec3=100
    tail 0x217359ec284e66def222e 0x42a00088462060003
Free Block Chain:
  0x3: 0000  00 04 00 96 80 1d 20 28 53 6f 75 72 63 65 5f 4c  ┆       (Source_L┆
  0x4: 0000  00 00 00 fd 80 10 20 20 77 68 65 6e 20 6f 74 68  ┆        when oth┆