Previous: karget Up: ../karrtn.html Next: karidx
INTEGER FUNCTION KARID2 (TEXTA,LOCA,LENA,
# TEXTB,LOCB,LENB)
Given two packed character strings defined by the
arguments TEXTA,LOCA,LENA and TEXTB,LOCB,LENB, search the
first string for the first occurrence of the second string,
ignoring letter case differences. If any of the arguments
LOCA, LENA, LOCB, or LENB are invalid, or if the second
string is not found in the first, return 0. Otherwise,
return its index, or position, in TEXTA(*), counting from
the first character stored in TEXTA(*). The result returned
is thus always 0, or not less than LOCA. For example,
KARID2(5HHELLO,LOC,5,2HLO,1,2) returns the value 4 if LOC =
1,2,3, or 4, since the second string begins at the fourth
position in the first string. If LOC is outside the range
1..4, then 0 is returned.
This function was not present in the original
proposal, and has been missed at times. It has been
officially added on 18-Jan-83.