Assembly Language Help (alang.hlp) (
Table of Contents;
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Search for String
◄Example► ◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
Syntax: @InStr([position], string1, string2)
name INSTR [position,] textitem1, textitem2
See also: SUBSTR, SIZESTR, CATSTR, TEXTEQU, Angle Brackets (<>),
expression operator (%)
Description:
The @InStr macro function searches for the first occurrence of
<string2> inside <string1> and returns the position of the
first character of the match. The search begins at <position>,
if you give that parameter. The @InStr function will not expand
macros or expressions unless you use the expression operator (%).
The first character is indexed as 1. @InStr returns 0 if
<string1> is not found.
The INSTR directive performs the same function as @InStr but
assigns the result to <name>. These two lines are equivalent:
develop TEXTEQU @InStr (2, <MikeBobMichaelJim>, <Mi>)
develop INSTR 2, <MikeBobMichaelJim>, <Mi>
;develop is now 8
Parameter Description
name Name of the resulting constant.
position Starting character position of the search
(default 1). Must be a positive integer.
string1 String being searched; any text.
string2 String to search for; any text.
textitem1 String being searched; any text item.
See: ◄text item►
textitem2 String to search for; any text item.
See: ◄text item►
-♦-