TNumArray3
Iz SDMS
Jump to navigationJump to searchRazred TNumArray3 je namenjen trodimenzionalni tabeli numeričnih vrednosti.
Lastnosti
Razred se naredi s funkcijo Rutine.CreateNumArray3.
Dim NA As TNumArray3
NA = CreateBooArray3 (3, 2, 2) // Alocira tabelo s 3x2x2 elementi
NA.Items(0,0,0) = 12 // Nastavi element
NA.Items(1,0,0) = 31 // Nastavi element
NA.Items(2,0,1) = 2 // Nastavi element
NA.Items(2,1,0) = 7.2 // Nastavi element
If NA.Items(2,0,1) = 2 Then // Uporabi vrednost elementa
NA.Count1 = 2 // Spremeni velikost tabele v 2x2x2
NA.Count2 = 3 // Spremeni velikost tabele v 2x3x2
NA.Count3 = 5 // Spremeni velikost tabele v 2x3x5
EndIf
Destroy (NA) // Dealocira tabeloCount1
Lastnost Count1 spremeni velikost prve dimenzije tabele. Vrednosti v tabeli se ohranijo.
| Property TNumArray3.Count1 As Long | ||
| Result | Long | Nova velikost tabele. |
Count2
Lastnost Count2 spremeni velikost druge dimenzije tabele. Vrednosti v tabeli se ohranijo.
| Property TNumArray3.Count2 As Long | ||
| Result | Long | Nova velikost tabele. |
Count3
Lastnost Count3 spremeni velikost tretje dimenzije tabele. Vrednosti v tabeli se ohranijo.
| Property TNumArray3.Count3 As Long | ||
| Result | Long | Nova velikost tabele. |
Items
Lastnost Items dostopa posamezni vrednosti v tabeli.
| Property TNumArray3.Items (Index1, Index2, Index3 As Long) As Float | ||
| Index1 | Long | Prvi indeks celice. Prvi element ima indeks 0. |
| Index2 | Long | Drugi indeks celice. Prvi element ima indeks 0. |
| Index3 | Long | Tretji indeks celice. Prvi element ima indeks 0. |
| Result | Float | Vrednost celice. |
Sort
Metoda Sort uredi celice po vrsti po prvi dimenziji. Za drugo in tretjo dimenzijo se uporabi indeks 0. Torej sortira glede na vrednosti (0,0,0), (1,0,0), (2,0,0),...
| Method TNumArray3.Sort |
| Nesortirano | Sortirano | ||
|---|---|---|---|
| 1,3 | 2,2 | 1,3 | 2,3 |
| 5,2 | 1,2 | 3,3 | 4,3 |
| 3,3 | 4,3 | 5,2 | 1,2 |
Opuščeno
Destroy
Metoda Destroy dealocira razred. Metoda je opuščena in se priporoča uporaba funkcije Rutine.Destroy.
| Method TNumArray3.Destroy |