Mitsubishi Electric CR750-Q Instruction Manual page 198

Cr750/cr751/cr760 series
Hide thumbs Also See for CR750-Q:
Table of Contents

Advertisement

4MELFA-BASIC V
ChrSrch (Character search)
[Function]
Searches the character string out of the character array.
[Format]
ChrSrch[]<Character string array variable>,<Character string>,<Search result storage destination>
[Terminology]
<Character string array variable>
<Character string>
<Search result storage destination> The number of the element for which the character string to be searched
[Reference Program]
1 Dim C1$(10)
2 C1$(1)="ABCDEFG"
3 C1$(2)="MELFA"
4 C1$(3)="BCDF"
5 C1$(4)="ABD"
6 C1$(5)="XYZ"
7 C1$(6)="MELFA"
8 C1$(7)="CDF"
9 C1$(8)="ROBOT"
10 C1$(9)="FFF"
11 C1$(10)="BCD"
12 ChrSrch C1$(1), "ROBOT", M1
13 ChrSrch C1$(1), "MELFA", M2
[Explanation]
(1) The specified character string is searched from the character string array variables, and the element
number of the completely matched character string array is set in <search result storage destination>.
Partially matched character strings are not searched.
Even if ChrSrch C1$(1), "ROBO", M1 are described in the above statement example, the matched
character string is not searched.
(2) If the character string to be searched is not found, 0 is set in <search result storage destination>.
(3) Character string search is performed sequentially beginning with element number 1, and the element
number found first is set.
Even if ChrSrch C1$(3), "MELFA", M2 are described in the above statement example, 2 is set in M2.
(The same character string is set in C1$(2) and C1$(6).)
(4) The <character string array variable> that can be searched is the one-dimensional array only. If a two-
dimensional or higher array is specified as a variable, an error will occur at the time of execution.
4-178 Detailed explanation of command words
Specify the character string array to be searched.
Specify the character string to be searched.
is found is set.
' 8 is set in M1.
' 2 is set in M2.

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cr750Cr751-qCr751-dCr760-dCr760-qCr750-d

Table of Contents