SORT/de

(Difference between revisions)
Jump to: navigation, search
(Remarks)
(See also)
Line 46: Line 46:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
= <span class="f_Header">See also</span> =
+
= <span class="f_Header">Siehe auch</span> =
  
 
<span style="font-family: Arial;">NONE</span>
 
<span style="font-family: Arial;">NONE</span>

Revision as of 23:08, 9 March 2013

Contents

Funktion

Sortiert ein Array in aufsteigender Reihenfolge.

 

 

Syntax

SORT array() [,elements]

 

 

Anmerkungen

array()

Das erste Element des zu sortierenden Arrays.

elements

Anzahl der zu sortierenden Elemente. Optionaler Parameter. Standardmäßig werden alle Elemente sortiert.

 

Sortieren funktioniert für Byte, Word und Integer Arrays.

Die Routinen sind in der mcs.lib.

 

 

 

Siehe auch

NONE

 

 

Example


'-------------------------------------------------------------------------------
' SORT.BAS
' (c) 1995-2011 , MCS Electronics
' This demo demonstrates the SORT statement. It will sort an array
' sort supports, byte, integer and word arrays at the first release
'------------------------------------------------------------------------------
$regfile = "m88def.dat"
$crystal = 8000000
$hwstack = 16
$swstack = 8
$framesize = 30
 
'Dim some arrays
Dim B(10) As Byte , I(10) As Integer , W(10) As Word
Dim J As Byte
 
'point to data
Restore Arraydata
 
'read the data
For J = 1 To 10
 Read B(j)
Next
'read the words
For J = 1 To 10
 Read W(j)
Next
'read the integers
For J = 1 To 10
 Read I(j)
Next
 
'now sort the arrays
Sort B(1) , 10 ' 10 elements
Sort W(1) ' all elements
Sort I(1)
 
'and show the result
For J = 1 To 10
 Print J ; " " ; B(j) ; " " ; W(j) ; " " ; I(j)
Next
End
 
 
 
 
Arraydata:
Data 1 , 4 , 8 , 9 , 2 , 5 , 3 , 7 , 6 , 4
Data 1000% , 101% , 1% , 400% , 30000% , 20000% , 15000% , 0% , 999% , 111%
Data -1000% , 101% , -1% , 400% , 30000% , 2000% , -15000% , 0% , 999% , 111%

Languages   English Deutsch  
Personal tools
Namespaces
Variants
Actions
Navigation
In other languages
Language