$: Array index to facilitate array operations (H)
⇒Help
⇒Contents
⇒Programming
(⇒Optional Keywords Syntax)
Bookmarks:
⇒block array operation
⇒factorial n
⇒set matrix rows
⇒vector elements = f(element index)
$ is the current array index in expressions of the type
array = some_expression_involving_the_linear_array_index
The global variable $ is set to 1 at the start of each script line.
A
block array operation
array = F($, ...) is equivalent to
DO $=1, len_array, 1
array($) = F($, ...)
ENDDO
vector elements = f(element index)
:
vector = $ ! evaluates to vector = (1,2,3,4,....)
vector = ($ - 1) * 1.001 ! set vector to (0.000, 1.001, 2.002, 3.003, ...)
factorial n
n!, execution sequence is $ = 1, 2, 3, ...
vector = vector($ - 1) * $ + ($ == 1) ! overflow for $ > 170 because 171! > 1E308
If an index is beyond the range of the array, the expression is 0 (e.g. vector($-1) for $ == 1)
($==1) is 1 for $=1, else it is 0. See Logicals
set matrix rows
of a n x n matrix MX to 0, 1, 2, 3, 4, ...
MX = MOD($-1, n)
©2000-2008 Georg Petrich, HicEst Instant Prototype Computing. All rights reserved.
Impressum