 |
hpoonis2010 Adept

Joined: 18 Jun 2019 Posts: 279
|
Posted: Tue May 12, 2020 8:45 pm
Arrays |
I am going to assume (quite logically) that arrays index themselves from 0 as in almost all computer langauges.
This is from the documentation:
arrget
| Code: |
Syntax: %arrget(arrayname,index)
Return an element from an array. This is like arrayname[index] in other languages. If you ask for an element that is not in the array, a null string is returned. Index values start at ZERO.
Examples:
#VAR a %array(1,"test","hello")
#SHOW %arrget(a,2)
displays:
test |
Alas, the output is actually 'hello' not 'test'.
However, sometimes I see nothing and sometimes I see the word. Not sure what is happening there. |
|
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4805 Location: Pensacola, FL, USA
|
Posted: Wed May 13, 2020 1:55 am |
I would assume you are correct.
0=1
1="test"
2="hello"
It seems like a typo in the documentation, nice catch. |
|
|
|
 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|