Page 1 of 1
[Implemented] PB constant for Replace/RemoveString()
Posted: Sat Sep 04, 2010 7:02 pm
by Demivec
The ReplaceString() and RemoveString() commands in the string library have PB constants defined for the non-default search mode to be used. They don't however have a constant for the default mode, nor is this value defined in the help file. The constant is needed to use the default search mode when a StartPosition is also specified with these commands.
Re: PB constant for default mode used for Replace/RemoveStri
Posted: Sat Sep 04, 2010 8:14 pm
by IdeasVacuum
Try ReplaceString(sgMacFileString,sFind,sReplace,
0,1)
Related to:
http://www.purebasic.fr/english/viewtop ... =4&t=43418
Re: PB constant for default mode used for Replace/RemoveStri
Posted: Sat Sep 04, 2010 8:50 pm
by Little John
IdeasVacuum wrote:Try ReplaceString(sgMacFileString,sFind,sReplace,0,1)
If this is the correct value for case sensitive search, then it will be a workaround ... but no satisfying solution.
The advantage of named constants is, that we do not have to deal with "magic numbers". That's the reason why a constant such as
#PB_String_NoCase does exist. So it's a matter of course, that a named constant say
#PB_String_Case will be of our advantage as well.
Regards, Little John
Re: PB constant for default mode used for Replace/RemoveStri
Posted: Sat Sep 04, 2010 11:51 pm
by Seymour Clufley
I agree. It's often puzzled me that there isn't a constant for this.