Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
28
Task/Arrays/Yabasic/arrays.basic
Normal file
28
Task/Arrays/Yabasic/arrays.basic
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
dim a(10) // create a numeric array with 11 elements, from 0 to 10
|
||||
// Indexed at your preference (0 to 9 or 1 to 10)
|
||||
print arraysize(a(), 1) // this function return the element's higher number of an array
|
||||
|
||||
a(7) = 12.3 // access to an element of the array
|
||||
redim a(20) // alias of 'dim'. Grouth size of array
|
||||
|
||||
// Yabasic not allow direct downsize an array, but ...
|
||||
|
||||
dim a$(20) // create a textual array with 21 elements
|
||||
|
||||
print arraysize(a$(), 1)
|
||||
|
||||
void = token("1,2,3,4,5,6,7,8,9,10", a$(), ",") // populate it. Begun with element 1 (not 0).
|
||||
|
||||
print arraysize(a$(), 1) // hey! the size is down
|
||||
|
||||
print a$(5) // show the content of an element of the array
|
||||
|
||||
void = token("", a$()) // "erase" the array content AND redim it to 0 size
|
||||
|
||||
print arraysize(a$(), 1)
|
||||
|
||||
redim a$(10) // resize the array
|
||||
|
||||
print arraysize(a$(), 1)
|
||||
|
||||
print a$(5) // show the content of an element of the array. Now is empty
|
||||
Loading…
Add table
Add a link
Reference in a new issue