Arrays: Difference between revisions

(Add Ecstasy example)
Line 6,055:
 
'CREATING A STATIC ARRAY
float ffs[100]
 
'SETTING INDEX BASE
Line 6,061:
 
'FILLING PART OF AN ARRAY
ffs[20]={2,4,6,8,10,12}
 
'MAPPING AN ARRAY TO ANOTHER
float *g
@g=@ffs[20]
print g[6] 'result 12
 
'DYNAMIC (RESIZEABLE) ARRAYS
redim float ffd(100)
ffd={2,4,6,8} 'assign some values
redim float ffd(200) 'expand array
print ffd(2) 'original values are preserved by default
redim float ffd(200) clear 'array elements are cleared
print ffd(2) 'value set to 0.0
redim float ffd(0) 'release allocated memory '
</syntaxhighlight>
 
54

edits