Ok,
I successfully created a DLL which gets half the job done. I feel so proud.
Anyways this is what the code looks like.
uses
SysUtils,
StrUtils,
Windows;
{$R *.res}
{$R cmdtable.res}
Function StrReplace(SearchString, Find, Replace: String): PChar; cdecl;
var
ResultString: String;
begin
ResultString := StringReplace(SearchString, Find, Replace, [rfReplaceAll,rfIgnoreCase]);
Result := PChar(ResultString);
end;
exports
StrReplace;
begin
end.
This is what my Dark Basic Pro code to execute looks like
test$="Dude Ther Are Testing woot there dude"
t$=RString(test$,"Testing","Woot")
print t$
wait key
Anyways as you can see its a ReplaceString DLL. My problem is that in DBP it will replace the first occurrance of the word to be found and then just stop.
So that DBP code I supplied will have an output like this:
When it should look like this:
Dude Ther Are Woot woot there dude
Why does it just stop after the first occurrance? Why doesnt it change what it needs to and continue to print out the rest of the string? Is it the way I converted my String into a PChar? My StringTable is correct but if for some strange reason you need to see it please tell me.
I would appreciate the help guys.
Thanks,
The Lone Programmer
Mess With The Best, Die Like The Rest.