StringFind() problems?

 
I think I've discovered a problem with the MQL function "StringFind()" in MetaTrader 4. When running the following code:

endIndex = StringFind("abcdefg abcdefg","d",9);
Print(endIndex);
return(0);

I get the error: "invalid integer number as parameter 1 for StringFind function". However, 'endIndex' ends up equaling 3 which is position of the first 'd'; not the second one.

Anyone else come across this problem?
 
will be fixed. thanxx for info
 
Just downloaded Build 137 and my original stringFind() problem has been fixed. I have noticed however that it seems to work in a different way to implementations of this type of function that I've seen in other languages.

e.g. In this example:

string splitString = "abcdefg abcdefg";
endIndex = StringFind(splitString,"c", 0);

endIndex = 2 which is fine. However, in the next example:

string splitString = "abcdefg abcdefg";
endIndex = StringFind(splitString,"c", 3);

endIndex = 7, (endIndex should actually = 10 if counting from the beginning of the string). It appears that StringFind() is starting to count from the offset (3), rather than counting from the beginning of the string. Is this the way that it's supposed to work?
 
thanx
 
StingFind() fixed in build 138 - thanx Slawa!
Reason: