TNumArray1: Razlika med redakcijama

Iz SDMS
Jump to navigationJump to search
m
m (Sort)
 
Vrstica 34: Vrstica 34:
 
Method|TNumArray1.Sort
 
Method|TNumArray1.Sort
 
</declaration>
 
</declaration>
 +
{| border="1"
 +
!Nesortirano!!Sortirano
 +
|-
 +
|1||1
 +
|-
 +
|5||3
 +
|-
 +
|3||5
 +
|}
  
 
==Opuščeno==
 
==Opuščeno==

Trenutna redakcija s časom 00:18, 22. januar 2011

Razred TNumArray1 je namenjen enodimenzionalni tabeli numeričnih vrednosti.

Lastnosti

Razred se naredi s funkcijo Rutine.CreateNumArray1.

Dim NA As TNumArray1
NA = CreateNumArray1 (3)    // Alocira tabelo s tremi elementi
NA.Items(0) = 12            // Nastavi prvi element
NA.Items(1) = 5             // Nastavi drugi element
NA.Items(2) = 55.5          // Nastavi tretji element 
NA.Sort                     // Uredi elemente po vrednosti
If NA.Items(1) = 12 Then    // Uporabi vrednost drugega elementa
  NA.Count = 2              // Spremeni velikost tabele
EndIf
Destroy (NA)                // Dealocira tabelo

Count

Lastnost Count spremeni velikost tabele. Vrednosti v tabeli se ohranijo.

Property TNumArray1.Count As Long
ResultLongNova velikost tabele.

Items

Lastnost Items dostopa posamezni vrednosti v tabeli.

Property TNumArray1.Items (Index As Long) As Float
IndexLongIndeks celice. Prvi element ima indeks 0.
ResultFloatVrednost celice.

Sort

Metoda Sort uredi celice po vrsti.

Method TNumArray1.Sort
Nesortirano Sortirano
1 1
5 3
3 5

Opuščeno

Destroy

Metoda Destroy dealocira razred. Metoda je opuščena in se priporoča uporaba funkcije Rutine.Destroy.

Method TNumArray1.Destroy