Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
2 posts • Page 1 of 1
2 posts
• Page 1 of 1
buec
Posts:28
Joined: Tue Dec 07, 2010 3:09 pm
Return value string.replace( )
Postby buec »
According to the help, string.replace(string before, string after) returns an int value. Unfortunately, there is no description of what this int represents. I assumed it was the number of replaced elements like strreplace( ). But the function always returns 0, no matter if something was replaced or not. Is this really wanted or rather a bug?
The help says explicitly at the beginning of "Member functions of standard data types" of the "Object Oriented Scripting (CTRL++)" page, just before the list of OOP-like methods for containers and strnigs:
In case of functions which return an integer without explicit explanation, the return value can be ignored since all errors will throw an exception
So basically those returns are error codes.
strreplace() does return the number of replacements though.