LOOKDOWN/de

From MCS Wiki AVR
< LOOKDOWN(Difference between revisions)
Jump to: navigation, search
m (1 revision)
(Example)
 
(5 intermediate revisions by one user not shown)
Line 1: Line 1:
== (**COPIED FROM ENGLISH PAGE**) === <span class="f_Header">Action</span> =
+
= <span class="f_Header">Funktion</span> =
  
Returns the index of a series of data.
+
Gibt einen Index einer Serie von Daten zurück.
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
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: 395px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 395px; border: 1px solid rgb(0, 0, 0);" |  
The returned index value
+
Der zurückgegebene Index
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
Line 30: Line 30:
  
 
| valign="top" width="100%" style="width: 395px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 395px; border: 1px solid rgb(0, 0, 0);" |  
The value to search for
+
Der zu suchende Wert
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
Line 37: Line 37:
  
 
| valign="top" width="100%" style="width: 395px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 395px; border: 1px solid rgb(0, 0, 0);" |  
The label where the data starts
+
Programmmarke an der die Datenserie beginnt.
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
Line 44: Line 44:
  
 
| valign="top" width="100%" style="width: 395px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 395px; border: 1px solid rgb(0, 0, 0);" |  
The number of entries that must be searched
+
Die Anzahl der Daten einer zu durchsuchenden Datenserie.
  
 
|}
 
|}
Line 50: Line 50:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
When you want to look in BYTE series the VALUE variable must be dimensioned as a BYTE. When you want to look in INTEGER or WORD series the VALUE variable must be dimensioned as an INTEGER.
+
Wenn Sie eine Serie von Bytes durchsuchen, muß VALUE vom Typ Byte sein. Wenn Sie eine Serie von Integer oder Words durchsuchen, muß VALUE vom Typ Integer sein.  
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
The LookDown function is the counterpart of the LookUp function.
+
Die LookDOWN Funktion ist der Zählerteil der LookUP  Funktion.
  
Lookdown will search the data for a value and will return the index when the value is found. It will return –1 when the data is not found.
+
LOOKDOWN durchsucht eine Datenserie nach einem Wert und gibt dessen Index zurück wenn er gefunden wurde, andernfalls -1.
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
Line 62: Line 62:
 
<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> =
  
 
[[LOOKUPSTR]]&nbsp;,&nbsp;[[LOOKUP]]
 
[[LOOKUPSTR]]&nbsp;,&nbsp;[[LOOKUP]]
Line 72: Line 72:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
= <span class="f_Header">Example</span> =
+
= <span class="f_Header">Beispiel</span> =
  
 
<br/><source lang="bascomavr">
 
<br/><source lang="bascomavr">

Latest revision as of 23:33, 4 March 2013

Contents

Funktion

Gibt einen Index einer Serie von Daten zurück.

 

 

Syntax

var = LOOKDOWN( value, label, entries)

 

 

Anmerkungen

Var

Der zurückgegebene Index

Value

Der zu suchende Wert

Label

Programmmarke an der die Datenserie beginnt.

entries

Die Anzahl der Daten einer zu durchsuchenden Datenserie.

 

Wenn Sie eine Serie von Bytes durchsuchen, muß VALUE vom Typ Byte sein. Wenn Sie eine Serie von Integer oder Words durchsuchen, muß VALUE vom Typ Integer sein.

 

Die LookDOWN Funktion ist der Zählerteil der LookUP Funktion.

LOOKDOWN durchsucht eine Datenserie nach einem Wert und gibt dessen Index zurück wenn er gefunden wurde, andernfalls -1.

 

 

Siehe auch

LOOKUPSTR , LOOKUP

 

 

 

Beispiel


'-----------------------------------------------------------------------------------------
'name : lookdown.bas
'copyright : (c) 1995-2005, MCS Electronics
'purpose : demo : LOOKDOWN
'micro : Mega48
'suited for demo : yes
'commercial addon needed : no
'-----------------------------------------------------------------------------------------
 
$regfile = "m48def.dat" ' specify the used micro
$crystal = 4000000 ' used crystal frequency
$baud = 19200 ' use baud rate
$hwstack = 32 ' default use 32 for the hardware stack
$swstack = 10 ' default use 10 for the SW stack
$framesize = 40 ' default use 40 for the frame space
 
Dim Idx As Integer , Search As Byte , Entries As Byte
 
'we want to search for the value 3
Search = 3
'there are 5 entries in the table
Entries = 5
 
'lookup and return the index
Idx = Lookdown(search , Label , Entries)
Print Idx
 
Search = 1
Idx = Lookdown(search , Label , Entries)
Print Idx
 
 
Search = 100
Idx = Lookdown(search , Label , Entries)
Print Idx ' return -1 if not found
 
 
'looking for integer or word data requires that the search variable is
'of the type integer !
Dim Isearch As Integer
Isearch = 400
Idx = Lookdown(isearch , Label2 , Entries)
Print Idx ' return 3
End
 
Label:
Data 1 , 2 , 3 , 4 , 5
 
Label2:
Data 1000% , 200% , 400% , 300%

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