TNumArray1: Razlika med redakcijama

Iz SDMS
Jump to navigationJump to search
m
m
Vrstica 1: Vrstica 1:
{{Work}}
 
 
Razred '''TNumArray1''' je namenjen enodimenzionalni tabeli numeričnih vrednosti.
 
Razred '''TNumArray1''' je namenjen enodimenzionalni tabeli numeričnih vrednosti.
 +
 +
==Lastnosti==
 +
Razred se naredi s funkcijo {{EL|Rutine|CreateNumArray1}}.
 +
<source>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</source>
  
 
===Count===
 
===Count===
Lastnost '''Count''' .
+
Lastnost '''Count''' spremeni velikost tabele. Vrednosti v tabeli se ohranijo.
 
<declaration>
 
<declaration>
 
Property|TNumArray1.Count
 
Property|TNumArray1.Count
Result|Long|.
+
Result|Long|Nova velikost tabele.
</declaration>
 
<source></source>
 
 
 
===Destroy===
 
Metoda '''Destroy''' .
 
<declaration>
 
Method|TNumArray1.Destroy
 
 
</declaration>
 
</declaration>
<source></source>
 
  
 
===Items===
 
===Items===
Lastnost '''Items''' .
+
Lastnost '''Items''' dostopa posamezni vrednosti v tabeli.
 
<declaration>
 
<declaration>
 
Property|TNumArray1.Items
 
Property|TNumArray1.Items
Index|Long|.
+
Index|Long|Indeks celice. Prvi element ima indeks 0.
Result|Float|.
+
Result|Float|Vrednost celice.
 
</declaration>
 
</declaration>
<source></source>
 
  
 
===Sort===
 
===Sort===
Metoda '''Sort''' .
+
Metoda '''Sort''' uredi celice po vrsti.  
 
<declaration>
 
<declaration>
 
Method|TNumArray1.Sort
 
Method|TNumArray1.Sort
 
</declaration>
 
</declaration>
<source></source>
+
 
 +
==Opuščeno==
 +
 
 +
===Destroy===
 +
Metoda '''Destroy''' dealocira razred. Metoda je opuščena in se priporoča uporaba funkcije {{EL|Rutine|Destroy}}.
 +
<declaration>
 +
Method|TNumArray1.Destroy
 +
</declaration>
  
 
[[Category:Razredi tabel|NumArr1]]
 
[[Category:Razredi tabel|NumArr1]]
 
[[Category:Razredi|NumArr1]]
 
[[Category:Razredi|NumArr1]]
 
[[Category:SDMS Basic|NumArr1]]
 
[[Category:SDMS Basic|NumArr1]]

Redakcija: 22:43, 29. december 2010

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

Opuščeno

Destroy

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

Method TNumArray1.Destroy