new files
This commit is contained in:
parent
3af7344581
commit
86c034bb8b
1364 changed files with 21352 additions and 0 deletions
17
Task/Binary-strings/Ada/binary-strings-1.ada
Normal file
17
Task/Binary-strings/Ada/binary-strings-1.ada
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
declare
|
||||
Data : Storage_Array (1..20); -- Data created
|
||||
begin
|
||||
Data := (others => 0); -- Assign all zeros
|
||||
if Data = (1..10 => 0) then -- Compare with 10 zeros
|
||||
declare
|
||||
Copy : Storage_Array := Data; -- Copy Data
|
||||
begin
|
||||
if Data'Length = 0 then -- If empty
|
||||
...
|
||||
end if;
|
||||
end;
|
||||
end if;
|
||||
... Data & 1 ... -- The result is Data with byte 1 appended
|
||||
... Data & (1,2,3,4) ... -- The result is Data with bytes 1,2,3,4 appended
|
||||
... Data (3..5) ... -- The result the substring of Data from 3 to 5
|
||||
end; -- Data destructed
|
||||
3
Task/Binary-strings/Ada/binary-strings-2.ada
Normal file
3
Task/Binary-strings/Ada/binary-strings-2.ada
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
type Octet is mod 2**8;
|
||||
for Octet'Size use 8;
|
||||
type Octet_String is array (Positive range <>) of Octet;
|
||||
4
Task/Binary-strings/Ada/binary-strings-3.ada
Normal file
4
Task/Binary-strings/Ada/binary-strings-3.ada
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
with Interfaces; use Interfaces;
|
||||
...
|
||||
type Octet is new Interfaces.Unsigned_8;
|
||||
type Octet_String is array (Positive range <>) of Octet;
|
||||
Loading…
Add table
Add a link
Reference in a new issue