ALIAS: Dynamically redefine arrays and strings with varying lengths (H)
⇒Help
⇒Contents
⇒Programming
(⇒Optional Keywords Syntax)
Bookmarks:
⇒collect scalars to a vector
⇒dynamically rename or redefine array segments
⇒rename or redefine string segments dynamically
⇒share storage
To facilitate array and string operations: rename (
share storage
) all or part of a numerical or string workspace at run-time
The ALIAS-names below (scalar, ..., subvec, ..., substring, ...) must not be referenced prior to the ALIAS statement
related subjects:
DIMENSION
,
REAL
,
CHARACTER
,
EDIT-Parse
collect scalars to a vector
:
vec = ALIAS(scalar1, scalar2, .., scalarN)
vec is now defined as a vector of length N:
vec(1) == scalar1
vec(2) == scalar2
...
vec(n) == scalarN
dynamically rename or redefine array segments
:
DIMENSION array(1E6)
ALIAS(array, idx, subvec1,dim1, subvec2, dim2, ...)
subvec1 is now defined as a vector of length dim1. It shares storage with array(idx : idx+dim1-1)
subvec2 is now defined as a vector of length dim2, etc.
in other words this equivalences
array(idx) with subvec1(1)
array(idx+1) with subvec1(2)
...
array(idx+dim1) with subvec2(1), etc.
rename or redefine string segments dynamically
:
CHARACTER string*123456
ALIAS(string, idx, substring1,len1, substring2, len2, ...)
substring1 is now another name for string(idx : idx + len1 -1)
substring2 is synonymous to string(idx + len1 : idx + len1 + len2 - 1)
©2000-2008 Georg Petrich, HicEst Instant Prototype Computing. All rights reserved.
Impressum