LOOKDOWN/de
(Difference between revisions)
(→(**COPIED FROM ENGLISH PAGE**) =) |
(→Remarks) |
||
Line 15: | Line 15: | ||
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
− | = <span class="f_Header"> | + | = <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);" | | ||
− | + | 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);" | | ||
− | + | 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);" | | ||
− | + | 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);" | | ||
− | + | Die Anzahl der Daten einer zu durchsuchenden Datenserie. | |
|} | |} | ||
Line 50: | Line 50: | ||
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
− | + | 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;"> </span> | <span style="font-family: Arial;"> </span> | ||
Line 56: | Line 56: | ||
The LookDown function is the counterpart of the LookUp function. | The LookDown function is the counterpart of the LookUp function. | ||
− | + | LOOKDOWN durchsucht eine Datenserie nach einem Wert und gibt dessen Index zurück wenn er gefunden wurde, andernfalls -1. | |
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> |
Revision as of 23:29, 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.
The LookDown function is the counterpart of the LookUp function.
LOOKDOWN durchsucht eine Datenserie nach einem Wert und gibt dessen Index zurück wenn er gefunden wurde, andernfalls -1.
See also
Example
'----------------------------------------------------------------------------------------- '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 |
---|