TNumArray1: Razlika med redakcijama

Iz SDMS
Jump to navigationJump to search
m (Nova stran z vsebino: {{Work}} Razred '''TBooArr1''' je namenjen enodimenzionalni tabeli numeričnih vrednosti. ===Count=== Lastnost '''Count''' . <declaration> Property|TNumArray1.Count Result|Lo...)
 
m (Sort)
 
(3 vmesne redakcije istega uporabnika niso prikazane)
Vrstica 1: Vrstica 1:
 +
Razred '''TNumArray1''' je namenjen enodimenzionalni tabeli numeričnih vrednosti.
  
{{Work}}
+
==Lastnosti==
Razred '''TBooArr1''' je namenjen enodimenzionalni tabeli numeričnih vrednosti.
+
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>
 
</declaration>
<source></source>
 
 
===Destroy===
 
Metoda '''Destroy''' .
 
<declaration>
 
Method|TNumArray1.Destroy
 
</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>
+
{| border="1"
 +
!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 {{EL|Rutine|Destroy}}.
 +
<declaration>
 +
Method|TNumArray1.Destroy
 +
</declaration>
  
[[Category:Razredi]]
+
[[Category:Razredi tabel|NumArr1]]
[[Category:SDMS Basic]]
+
[[Category:Razredi|NumArr1]]
 +
[[Category:SDMS Basic|NumArr1]]

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