TNumArray3: Razlika med redakcijama
Iz SDMS
Jump to navigationJump to searchm |
m |
||
| Vrstica 1: | Vrstica 1: | ||
| − | |||
Razred '''TNumArray3''' je namenjen trodimenzionalni tabeli numeričnih vrednosti. | Razred '''TNumArray3''' je namenjen trodimenzionalni tabeli numeričnih vrednosti. | ||
| + | |||
| + | ==Lastnosti== | ||
| + | Razred se naredi s funkcijo {{EL|Rutine|CreateNumArray3}}. | ||
| + | <source>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 tabelo</source> | ||
===Count1=== | ===Count1=== | ||
| − | Lastnost '''Count1''' . | + | Lastnost '''Count1''' spremeni velikost prve dimenzije tabele. Vrednosti v tabeli se ohranijo. |
<declaration> | <declaration> | ||
Property|TNumArray3.Count1 | Property|TNumArray3.Count1 | ||
| − | Result|Long|. | + | Result|Long|Nova velikost tabele. |
</declaration> | </declaration> | ||
| − | |||
===Count2=== | ===Count2=== | ||
| − | Lastnost '''Count2''' . | + | Lastnost '''Count2''' spremeni velikost druge dimenzije tabele. Vrednosti v tabeli se ohranijo. |
<declaration> | <declaration> | ||
Property|TNumArray3.Count2 | Property|TNumArray3.Count2 | ||
| − | Result|Long|. | + | Result|Long|Nova velikost tabele. |
</declaration> | </declaration> | ||
| − | |||
===Count3=== | ===Count3=== | ||
| − | Lastnost '''Count3''' . | + | Lastnost '''Count3''' spremeni velikost tretje dimenzije tabele. Vrednosti v tabeli se ohranijo. |
<declaration> | <declaration> | ||
Property|TNumArray3.Count3 | Property|TNumArray3.Count3 | ||
| − | Result|Long|. | + | Result|Long|Nova velikost tabele. |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
</declaration> | </declaration> | ||
| − | |||
===Items=== | ===Items=== | ||
| − | Lastnost '''Items''' . | + | Lastnost '''Items''' dostopa posamezni vrednosti v tabeli. |
<declaration> | <declaration> | ||
Property|TNumArray3.Items | Property|TNumArray3.Items | ||
| − | Index1|Long|. | + | Index1|Long|Prvi indeks celice. Prvi element ima indeks 0. |
| − | Index2|Long|. | + | Index2|Long|Drugi indeks celice. Prvi element ima indeks 0. |
| − | Index3|Long|. | + | Index3|Long|Tretji indeks celice. Prvi element ima indeks 0. |
| − | Result|Float|. | + | Result|Float|Vrednost celice. |
</declaration> | </declaration> | ||
| − | |||
===Sort=== | ===Sort=== | ||
| − | Metoda '''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),... |
<declaration> | <declaration> | ||
Method|TNumArray3.Sort | Method|TNumArray3.Sort | ||
</declaration> | </declaration> | ||
| − | < | + | {| border="1" |
| + | !colspan="2"|Nesortirano!!colspan="2"|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 {{EL|Rutine|Destroy}}. | ||
| + | <declaration> | ||
| + | Method|TNumArray3.Destroy | ||
| + | </declaration> | ||
[[Category:Razredi tabel|NumArr3]] | [[Category:Razredi tabel|NumArr3]] | ||
[[Category:Razredi|NumArr3]] | [[Category:Razredi|NumArr3]] | ||
[[Category:SDMS Basic|NumArr3]] | [[Category:SDMS Basic|NumArr3]] | ||
Trenutna redakcija s časom 01:53, 22. januar 2011
Razred 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 |