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

⟦725c47309⟧ Ada Source

    Length: 4096 (0x1000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body String_Operations, seg_02bb17

Derivation

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

E3 Source Code



package body String_Operations is

    function Is_Alpha_String (The_String : String) return Boolean is
        type Status is (Passed, Failed);
        Test_Status : Status := Passed;
    begin
        if The_String = "" then
            Test_Status := Failed;
        else
            Check_String:
                for Char in (The_String'First) .. The_String'Last loop
                    case The_String (Char) is
                        when 'a' .. 'z' | 'A' .. 'Z' =>
                            Test_Status := Passed;
                        when others =>
                            Test_Status := Failed;
                            exit Check_String;
                    end case;
                end loop Check_String;
        end if;
        if Test_Status = Passed then
            return True;
        else
            return False;
        end if;
    end Is_Alpha_String;


    function Is_Alpha_Numeric_String (The_String : String) return Boolean is
        type Status is (Passed, Failed);
        Test_Status : Status := Passed;
    begin
        if The_String = "" then
            Test_Status := Failed;
        else
            Check_String:
                for Char in (The_String'First) .. The_String'Last loop
                    case The_String (Char) is
                        when 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' =>
                            Test_Status := Passed;
                        when others =>
                            Test_Status := Failed;
                            exit Check_String;
                    end case;
                end loop Check_String;
        end if;
        if Test_Status = Passed then
            return True;
        else
            return False;
        end if;
    end Is_Alpha_Numeric_String;


    function Is_Alpha_Numeric_Underscore_String
                (The_String : String) return Boolean is
        type Status is (Passed, Failed);
        Test_Status : Status := Passed;
    begin
        if The_String = "" then
            Test_Status := Failed;
        else
            Check_String:
                for Char in The_String'First .. The_String'Last loop
                    case The_String (Char) is
                        when 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' =>
                            Test_Status := Passed;
                        when others =>
                            Test_Status := Failed;
                            exit Check_String;
                    end case;
                end loop Check_String;
        end if;
        if Test_Status = Passed then
            return True;
        else
            return False;
        end if;
    end Is_Alpha_Numeric_Underscore_String;

end String_Operations;

E3 Meta Data

    nblk1=3
    nid=0
    hdr6=6
        [0x00] rec0=1e rec1=00 rec2=01 rec3=086
        [0x01] rec0=1c rec1=00 rec2=02 rec3=04e
        [0x02] rec0=19 rec1=00 rec2=03 rec3=000
    tail 0x217248b2e83f080a65506 0x42a00088462060003