Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
11
Task/Arrays/Harbour/arrays-1.harbour
Normal file
11
Task/Arrays/Harbour/arrays-1.harbour
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// Declare and initialize two-dimensional array
|
||||
local arr1 := { { "NITEM", "N", 10, 0 }, { "CONTENT", "C", 60, 0 } }
|
||||
// Create an empty array
|
||||
local arr2 := {}
|
||||
// Declare three-dimensional array
|
||||
local arr3[ 2, 100, 3 ]
|
||||
// Create an array
|
||||
local arr4 := Array( 50 )
|
||||
|
||||
// Array can be dynamically resized:
|
||||
arr4 := ASize( arr4, 80 )
|
||||
6
Task/Arrays/Harbour/arrays-2.harbour
Normal file
6
Task/Arrays/Harbour/arrays-2.harbour
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
// Adding new item to array, its size is incremented
|
||||
AAdd( arr1, { "LBASE", "L", 1, 0 } )
|
||||
// Delete the first item of arr3, The size of arr3 remains the same, all items are shifted to one position, the last item is replaced by Nil:
|
||||
ADel( arr1, 1 )
|
||||
// Assigning a value to array item
|
||||
arr3[ 1, 1, 1 ] := 11.4
|
||||
2
Task/Arrays/Harbour/arrays-3.harbour
Normal file
2
Task/Arrays/Harbour/arrays-3.harbour
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
x := arr3[ 1, 10, 2 ]
|
||||
// The retrieved item can be nested array, in this case it isn't copied, the pointer to it is assigned
|
||||
7
Task/Arrays/Harbour/arrays-4.harbour
Normal file
7
Task/Arrays/Harbour/arrays-4.harbour
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
// Fill the 20 items of array with 0, starting from 5-th item:
|
||||
AFill( arr4, 0, 5, 20 )
|
||||
// Copy 10 items from arr4 to arr3[ 2 ], starting from the first position:
|
||||
ACopy( arr4, arr3[ 2 ], 1, 10 )
|
||||
// Duplicate the whole or nested array:
|
||||
arr5 := AClone( arr1 )
|
||||
arr6 := AClone( arr1[ 3 ] )
|
||||
Loading…
Add table
Add a link
Reference in a new issue