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