SORT/de

(Difference between revisions)
Jump to: navigation, search
((**COPIED FROM ENGLISH PAGE**) =)
(Remarks)
Line 15: Line 15:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
= <span class="f_Header">Remarks</span> =
+
= <span class="f_Header">Anmerkungen</span> =
 
<div style="padding: 0px; margin: 0px 0px 0px 4px;">
 
<div style="padding: 0px; margin: 0px 0px 0px 4px;">
 
{| width="488" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;"
 
{| width="488" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;"
Line 23: Line 23:
  
 
| valign="top" width="100%" style="width: 376px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 376px; border: 1px solid rgb(0, 0, 0);" |  
The first element of the array to sort.
+
Das erste Element des zu sortierenden Arrays.
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
Line 30: Line 30:
  
 
| valign="top" width="100%" style="width: 376px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 376px; border: 1px solid rgb(0, 0, 0);" |  
The number of elements to sort. This is an optional value. By default all elements will be sorted.
+
Anzahl der zu sortierenden Elemente. Optionaler Parameter. Standardmäßig werden alle Elemente sortiert.
  
 
|}
 
|}
Line 36: Line 36:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
Sorting is implemented for byte, word and integer arrays.
+
Sortieren funktioniert für Byte, Word und Integer Arrays.
  
The routines are located in mcs.lib.
+
Die Routinen sind in der mcs.lib.
  
 
&nbsp;
 
&nbsp;

Revision as of 23:07, 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.

 

 

 

See also

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