Seed7 - The extensible programming language
Seed7 FAQ Manual Screenshots Examples Libraries Algorithms Download Links
Libraries AES ARC4 Array ASN.1 Bigfile Bigint Bigrat Bin32 Bin64 Bitdata Bitmapfont Bitset Bitsetof Boolean Browser Bstring Bytedata Cards Category CC config Cgi Cgi dialog Char Charsets Cipher Clib_file Color CLI Commands Complex Console Crc32 Deflate DES Dialog Dir Draw Duration Echo Editline Enable_input Enable_io Enable_output Encoding Environment External_file File File system Float Font Forloop Ftp Getf Gethttp Gethttps Graph Graph_file Gzip Hash Hashsetof Hmac Html_ent Httpserv Idxarray Image Inflate Inflate file Inifile Integer Keybd Line Listener LZW Make Math Msgdigest Null_file Osfiles Picture utility Pixmap_file Pixmapfont PKCS #1 Poll Process Progs Propertyfile Rational Reference Ref_list Scanfile Scanstri Set Shell Smtp Sockbase Socket SQL base Stdio Strifile String Stritext Subrange Tar Text Time TLS/SSL Triple DES Unicode Utf16 Utf8 Vectorfont 3D Vector Wildcard Window Wrinum X.509 Xmldom Xml_ent Zip
Libraries
Ref_list Source Code
 previous   up   next 

Types
ref_list
Type to describe a list of reference objects.

ref_list

const type: ref_list

Type to describe a list of reference objects.


Operator Summary
void
(inout ref_list: dest) &:= (in ref_list: extension)
Append the ref_list extension to dest.
void
(inout ref_list: dest) @:= [ (in integer: position) ] (in reference: source)
Assign reference source to the position of the dest.
boolean
(in ref_list: refList1) = (in ref_list: refList2)
Check if two ref_lists are equal.
boolean
(in ref_list: refList1) <> (in ref_list: refList2)
Check if two ref_lists are not equal.
reference
(in ref_list: aRefList) [ (in integer: index) ]
Access one element from the ref_list aRefList.
ref_list
(in ref_list: aRefList) [ (in integer: start) .. ]
Get a sublist from aRefList beginning at a start position.
ref_list
(in ref_list: aRefList) [ .. (in integer: stop) ]
Get a sublist from aRefList ending at a stop position.
ref_list
(in ref_list: aRefList) [ (in integer: start) .. (in integer: stop) ]
Get a sublist from a start position to a stop position.
ref_list
(in ref_list: refList1) & (in ref_list: refList2)
Concatenate two ref_lists.
boolean
(in reference: element) in (in ref_list: aRefList)
Membership test for a ref_list.
boolean
(in reference: element) not in (in ref_list: aRefList)
Negated membership test for a ref_list.

Function Summary
ref_list
make_list (in reference: element)
Create ref_list with the given element.
integer
pos (in ref_list: main, in reference: searched)
Search for the first occurance of searched in main.
integer
pos (in ref_list: main, in reference: searched, in integer: start)
Search for searched in main at or after start.
integer
length (in ref_list: aRefList)
Determine the length of a ref_list.
void
for (inout reference: variable) range (in ref_list: aRefList) do (in proc: statement) end for
For-loop where forVar loops over the elements of aRefList.

Operator Detail

&:=

const proc: (inout ref_list: dest) &:= (in ref_list: extension)

Append the ref_list extension to dest.

Raises:
MEMORY_ERROR - Not enough memory for the concatenated ref_list.

@:= [

const proc: (inout ref_list: dest) @:= [ (in integer: position) ] (in reference: source)

Assign reference source to the position of the dest.

A @:= [B] C;

is equivalent to

A := A[..pred(B)] & make_list(C) & A[succ(B)..];
Raises:
RANGE_ERROR - When position is negative or zero.
RANGE_ERROR - An element beyond dest would be overwritten (position > length(dest) holds).

=

const func boolean: (in ref_list: refList1) = (in ref_list: refList2)

Check if two ref_lists are equal.

Returns:
TRUE if both ref_lists are equal, FALSE otherwise.

<>

const func boolean: (in ref_list: refList1) <> (in ref_list: refList2)

Check if two ref_lists are not equal.

Returns:
FALSE if both ref_lists are equal, TRUE otherwise.

[

const func reference: (in ref_list: aRefList) [ (in integer: index) ]

Access one element from the ref_list aRefList.

Returns:
the element with the specified index from aRefList.
Raises:
RANGE_ERROR - When the index is less than 1 or greater than the length of the ref_list.

[

const func ref_list: (in ref_list: aRefList) [ (in integer: start) .. ]

Get a sublist from aRefList beginning at a start position. The first element in a ref_list has the position 1.

Returns:
the sublist beginning at the start position.
Raises:
MEMORY_ERROR - Not enough memory to represent the result.

[ ..

const func ref_list: (in ref_list: aRefList) [ .. (in integer: stop) ]

Get a sublist from aRefList ending at a stop position. The first element in a ref_list has the position 1.

Returns:
the substring ending at the stop position.
Raises:
MEMORY_ERROR - Not enough memory to represent the result.

[

const func ref_list: (in ref_list: aRefList) [ (in integer: start) .. (in integer: stop) ]

Get a sublist from a start position to a stop position. The first element in a ref_list has the position 1.

Returns:
the substring from position start to stop.
Raises:
MEMORY_ERROR - Not enough memory to represent the result.

&

const func ref_list: (in ref_list: refList1) & (in ref_list: refList2)

Concatenate two ref_lists.

Returns:
the result of the concatenation.
Raises:
MEMORY_ERROR - Not enough memory to represent the result.

in

const func boolean: (in reference: element) in (in ref_list: aRefList)

Membership test for a ref_list. Determine if aRefList contains element.

Returns:
TRUE when element is a member of aRefList, FALSE otherwise.

not in

const func boolean: (in reference: element) not in (in ref_list: aRefList)

Negated membership test for a ref_list. Determine if aRefList does not contain element.

Returns:
FALSE when element is a member of aRefList, TRUE otherwise.

Function Detail

make_list

const func ref_list: make_list (in reference: element)

Create ref_list with the given element.

Returns:
a ref_list of length 1 with the given element.
Raises:
MEMORY_ERROR - Not enough memory to represent the result.

pos

const func integer: pos (in ref_list: main, in reference: searched)

Search for the first occurance of searched in main. The first element in a ref_list has the position 1.

Returns:
the position of searched or 0 when main does not contain searched.

pos

const func integer: pos (in ref_list: main, in reference: searched, in integer: start)

Search for searched in main at or after start. The search begins at position start and proceeds to the end. The first element in a ref_list has the position 1. The pos function is designed to allow loops like:

index := pos(aList, aReference);
while index <> 0 do
  # Do something with index
  index := pos(aList, aReference, succ(index));
end while;
Returns:
the position of searched or 0 when main does not contain searched at or after start.
Raises:
RANGE_ERROR - start <= 0 holds.

length

const func integer: length (in ref_list: aRefList)

Determine the length of a ref_list.

Returns:
the length of the ref_list.

for

const proc: for (inout reference: variable) range (in ref_list: aRefList) do (in proc: statement) end for

For-loop where forVar loops over the elements of aRefList.



 previous   up   next