DATA: to initialize numeric entities at compile time
⇒Home
⇒Contents
⇒more on Programming
a DATA statement assigns initial values to variables before program execution:
DATA variable/NumericConstant/ [, variable/NumericConstant/, ...]
DATA array[(i [,j])]/NumericConstant [,NumericConstant,..]/
2-dimensional arrays are stored
row by row
in
HicEst
examples:
DATA L/5/
! defines the variable L and defines its value at compile time
DIMENSION
vector(L)
! defines a vector of length L
DATA vector/5, 4, 3, 2, 1/
! set the elements of vector at compile time
REAL
:: m=3, n=4, matrix(m, n)
! another way to define scalars and arrays
DATA matrix/1, 2, 3, 4, 5, 6, 7, 8, 9/
! set matrix row by row
DATA matrix(2,1)/-21,-22,-23/
! set the first 3 elements of row2
©2000-2010 Georg Petrich, HicEst Instant Prototype Computing.
All rights reserved.
Impressum