VECTOR - create a B vector and initialize its contents.
Alternate entries: .VECTR
Usage:
B:
vec = vector( size [, value, value, value, ...] );
C:
int vector(int size, ...);
Where:
- size
- specifies the maximum index of the vector being allocated.
Thus the vector will actually have "size + 1" words.
- value, value, value, ...
- is a list of initialization values for the elements of the new vector.
If the number of initialization values is greater than
"size", "size" is ignored and the vector is made as large as necessary.
If the number of initialization values is less than "size", the first
vector elements will be initialized and the rest will be undefined.
- vec
- points to the start of the initialized vector.
Description:
VECTOR first calls GETVEC to obtain a block
of memory of the requested size from free memory.
The contents of the new vector are set to the values given
and a pointer to the vector is returned.
To initialize a vector to a list of identical values,
the function ZERO is recommended.
Examples:
vec = vector (6, '1st', '2nd', '3rd');
Allocates a seven-word vector and set the first three words
to the ASCII character constants shown.
See Also:
expl b lib getvec
expl b lib zero
Copyright © 2000, Thinkage Ltd.