Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,45 @@
$ include "seed7_05.s7i";
# Define hash type
const type: myHashType is hash [string] integer;
# Define hash table
var myHashType: aHash is myHashType.value;
const proc: main is func
local
var string: stri is "";
var integer: number is 0;
begin
# Add elements
aHash @:= ["foo"] 42;
aHash @:= ["bar"] 100;
# Check presence of an element
if "foo" in aHash then
# Access an element
writeln(aHash["foo"]);
end if;
# Change an element
aHash @:= ["foo"] 7;
# Remove an element
excl(aHash, "foo");
# Loop over the hash values
for number range aHash do
writeln(number);
end for;
# Loop over the hash keys
for key stri range aHash do
writeln(stri);
end for;
# Loop over hash keys and values
for number key stri range aHash do
writeln("key: " <& stri <& ", value: " <& number);
end for;
end func;