|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T V
Length: 4024 (0xfb8)
Types: TextFile
Names: »V«
└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
└─⟦5cb1d1d7f⟧ »DATA«
└─⟦3b1ee7bd8⟧
└─⟦this⟧
with Text_Io;
use Text_Io;
package Dyn is
-----------------------------------------------------------------
-- This is a package of several string manipulation functions
-- based on a built-in dynamic string type DYN_STRING. It is
-- an adaptation and extension of the package proposed by
-- Sylvan Rubin of Ford Aerospace and Communications
-- Corporation in the Nov/Dec 1984 issue of the Journal of
-- Pascal, Ada and Modula-2. Some new functions have been
-- added, the SUBSTRING function has been modified to permit
-- it to return the right part of a string if the third parameter
-- is permitted to default, and much of the body code has
-- been rewritten.
------------------------------------------------------------------
-- R.G. Cleaveland 07 December 1984:
-- Implementation initially with the Telesoft Ada version
-- This required definition of the DYN_STRING type without use of
-- a discriminant; an arbitrary maximum string length was chosen.
-- This should be changed when an improved compiler is available.
------------------------------------------------------------------
-- Richard Powers 03 January 1985:
-- changed to be used with a real compiler.
-- Some of the routines removed by my whim.
------------------------------------------------------------------
-- Richard Powers 26 January 1985:
-- Added UPPER_CASE function
------------------------------------------------------------------
type Dyn_String is private;
String_Too_Short : exception;
function D_String (Char : Character) return Dyn_String;
-- Creates a one-byte dynamic string of contents CHAR.
function D_String (Str : String) return Dyn_String;
-- Creates a dynamic string of contents STR.
-- The following four functions convert from
-- dynamic strings to the desired representation:
function Char (Dstr : Dyn_String) return Character;
function Str (Dstr : Dyn_String) return String;
function Int (Dstr : Dyn_String) return Integer;
function Flt (Dstr : Dyn_String) return Float;
function Length (Dstr : Dyn_String) return Natural;
function "<" (Ds1, Ds2 : Dyn_String) return Boolean;
function "&" (Ds1, Ds2 : Dyn_String) return Dyn_String;
function Substring
(Dstr : Dyn_String; -- Returns a subpart of this string
Start : Natural; -- starting at this position
Length : Natural := 0) -- and of this length.
return Dyn_String;
-- if LENGTH is zero or not specified, the remainder of the
-- string is returned (eg the "RIGHT" function).
function Index
(Source_String, --If this string contains
Pattern_String :
Dyn_String; --this string starting at or AFTER
Start_Pos : Integer) --this position, the position of
return Integer; --such start is returned.
-- If the string lengths prohibit the search -1 is returned.
-- If no match was found, 0 is returned.
-- (This is like the INSTR function of BASIC).
function Rindex
(Source_String, --If this string contains
Pattern_String :
Dyn_String; --this string starting at or BEFORE
Start_Pos : Integer) --this position, the position of
return Integer; --such start is returned.
-- If the string lengths prohibit the search -1 is returned.
-- If no match was found, 0 is returned.
function Upper_Case (Strg : in Dyn.Dyn_String) return String;
-- Return the input string in upper case
private
type String_Contents (Size : Natural := 0) is
record
Data : String (1 .. Size);
end record;
type Dyn_String is access String_Contents;
end Dyn;
-----------------------------------------------------------------