Oxygen Basic
Programming => Problems & Solutions => Topic started by: chrisc on March 20, 2018, 07:49:33 PM
-
Hello
Is there any example on arrays?
in PB, we define array as
DIM k(1 TO 8) AS STRING
how to do in O2?
-
Hi Chris,
The default indexbase is 1. So:
dim k(8) as string
dim as string k(8)
dim string k(8)
string k[8] 'C style
You can change the indexbase at any time. It alters your frame of reference:
indexbase 0
indexbase 1
-
Thanxx Charles
can we do something like : starting from elem 5 to 8 ?
dim k(5:8) as string
instead of
indexbase 5
dim k(8) as string
-
Not at present, Chris. o2 arrays are primitive. Dim string k[8] and ignore elements 1 to 4