CHARPOS/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="549" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;"
 
{| width="549" 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: 461px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 461px; border: 1px solid rgb(0, 0, 0);" |  
Numeric variable that will be assigned with the position of the sub string in the string. Returns 0 when the sub string is not found.
+
Numerische Variable in die die Position der Such-Zeichenkette gespeichert wird.
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
Line 30: Line 30:
  
 
| valign="top" width="100%" style="width: 461px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 461px; border: 1px solid rgb(0, 0, 0);" |  
The string to search.
+
Zeichenkette, in der gesucht wird.
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
Line 37: Line 37:
  
 
| valign="top" width="100%" style="width: 461px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 461px; border: 1px solid rgb(0, 0, 0);" |  
The search string. This can be a numeric variable too. For example a byte. When a string is used, only the first character will be used for the search.
+
Such-Zeichenkette. Kann auch eine numerische Variable sein. Zum Beispiel ein Byte. Wenn eine ZeichenKETTE benutzt wird dann wird nur nach dem ersten Zeichen der Zeichenkette gesucht.
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
Line 44: Line 44:
  
 
| valign="top" width="100%" style="width: 461px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 461px; border: 1px solid rgb(0, 0, 0);" |  
An optional start position where the searching must start.
+
Optionale Startposition ab der die Suche beginnen soll.
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
Line 51: Line 51:
  
 
| valign="top" width="100%" style="width: 461px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 461px; border: 1px solid rgb(0, 0, 0);" |  
If you specify an offset, Charpos will check if the offset is not located after the string. For example , when the string is "abc" and you specify an offset of 10, it will be located after the string.
+
Wenn ein offset angegeben wurde dann prüft die CHARPOS-Funktion mit SAFE, ob der offset außerhalb der Zeichenkette ist. Ist zum Beispiel die Zeichenkette "abc" und der offset 10 dann wäre der offset außerhalb der Zeichenkette.
  
The SAFE option is default. When you specify SPEED, the compiler will add the offset without checking. This will result in shorter and quicker code.
+
SAFE ist Standardwert.
 +
 
 +
Wenn SPEED angegeben wird dann benutzt der Compiler den offset ohne Prüfung. Es ergibt sich ein kürzerer und schnellerer Programmcode.
  
 
|}
 
|}
Line 59: Line 61:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
No constant can be used for string it must be a string variable.
+
Konstanten können für string nicht benutzt werden. Nur Zeichenketten-VARIABLE.
  
[[File:Notice.jpg|left|Notice.jpg]]The search is sensitive to case.
+
[[File:Notice.jpg|left|Notice.jpg]]Die Suche unterscheidet Groß- und Kleinschreibung.
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>

Revision as of 01:31, 21 February 2013

Contents

Funktion

Gibt die Position eines einzelnen Zeichens in einer Zeichenkette zurück.

 

 

Syntax

pos = CHARPOS(string , search [,start [,SAFE]])

 

 

Anmerkungen

Pos

Numerische Variable in die die Position der Such-Zeichenkette gespeichert wird.

String

Zeichenkette, in der gesucht wird.

Search

Such-Zeichenkette. Kann auch eine numerische Variable sein. Zum Beispiel ein Byte. Wenn eine ZeichenKETTE benutzt wird dann wird nur nach dem ersten Zeichen der Zeichenkette gesucht.

Offset

Optionale Startposition ab der die Suche beginnen soll.

SAFE

Wenn ein offset angegeben wurde dann prüft die CHARPOS-Funktion mit SAFE, ob der offset außerhalb der Zeichenkette ist. Ist zum Beispiel die Zeichenkette "abc" und der offset 10 dann wäre der offset außerhalb der Zeichenkette.

SAFE ist Standardwert.

Wenn SPEED angegeben wird dann benutzt der Compiler den offset ohne Prüfung. Es ergibt sich ein kürzerer und schnellerer Programmcode.

 

Konstanten können für string nicht benutzt werden. Nur Zeichenketten-VARIABLE.

Notice.jpg
Die Suche unterscheidet Groß- und Kleinschreibung.

 

 

See also

SPLIT , INSTR , REPLACECHARS , DELCHAR , INSERTCHAR , DELCHARS

 

 

Example


'-------------------------------------------------------------------------------
' charpos.bas
' (c) 1995-2009 MCS Electronics
$regfile = "m88def.dat"
$crystal = 8000000
$baud = 19200
'-------------------------------------------------------------------------------
Dim S As String * 20
Dim Bpos As Byte
Dim Z As String * 1
 
Z = "*"
Do
Input "S:" , S
 Bpos = Charpos(s , Z)
Print Bpos
Loop Until S = ""
 
 
Do
Input "S:" , S
 Bpos = Charpos(s , "A") ' notice charpos is sensitive to case
Print Bpos
Loop

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