Anyone know a function that does effectively string replace in MPL?
Anyone know a function that does effectively string replace in MPL?
On 25 Sep 2020, nugax said the following...
Anyone know a function that does effectively string replace in MPL?
Not quite sure what you're trying to do, but there is a REPLACE function in MPL.
Function REPLACE(Str1, Str2, Str3 : String) : String
This function replaces all occurances of a supplied text and returns a string. Ex:
Var Str : String = 'Hello Hello Hello';
Str := Replace(Str, 'Hello', 'World'); // Str is now World World World
Is that something you were looking for?
---
Black Panther(RCS)
aka Dan Richter
Castle Rock BBS
telnet://bbs.castlerockbbs.com
http://www.castlerockbbs.com
http://github.com/DRPanther
The sparrows are flying again...
Function REPLACE(Str1, Str2, Str3 : String) : String
Yes, thats exactly what I was looking for. Thanks!
On 25 Sep 2020, nugax said the following...
Function REPLACE(Str1, Str2, Str3 : String) : String
Yes, thats exactly what I was looking for. Thanks!
You're welcome. I just happened to be working on an MPL when I saw the >message. I checked my handy .doc file, and copied the info. ;)
---
Black Panther(RCS)
aka Dan Richter
Castle Rock BBS
telnet://bbs.castlerockbbs.com
http://www.castlerockbbs.com
http://github.com/DRPanther
The sparrows are flying again...
--- Mystic BBS v1.12 A46 2020/08/25 (Linux/64)
* Origin: Castle Rock BBS - bbs.castlerockbbs.com - (10:102/11)
What doc file?!
On 26 Sep 2020, nugax said the following...
What doc file?!
I've got a doc file that I believe Gryphon had put together awhile back, and >I think it was Dream Master that had updated it, at least for A36. It's pretty >current with all of the MPL functions available. Great reference material.
I've got it here on CRBBS. Filename is mpl_112a36.zip. It is also available >for FReq, using the same filename.
---
Black Panther(RCS)
aka Dan Richter
Castle Rock BBS
telnet://bbs.castlerockbbs.com
http://www.castlerockbbs.com
http://github.com/DRPanther
The sparrows are flying again...
--- Mystic BBS v1.12 A46 2020/08/25 (Linux/64)
* Origin: Castle Rock BBS - bbs.castlerockbbs.com - (10:102/11)
Anyone know a function that does effectively string replace in MPL?
I've got a doc file that I believe Gryphon had put together awhile back, and I think it was Dream Master that had updated it, at least for A36. It's pretty current with all of the MPL functions available. Great reference material.
I've got a doc file that I believe Gryphon had put together awhile ba and I think it was Dream Master that had updated it, at least for A36 It's pretty current with all of the MPL functions available. Great reference material.
yes i did and i need to update it again.
i wrote one in mpl long time ago when i started working on master mind
and then g00r00 added replace years ago. the original and still works is
function StrTran (source : string; old : string; new : string) : string;
begin
while pos (old, source) <> 0 do
begin
pp := pos (old, source);
delete (source, pp, length(old));
insert (new, source, pp);
end
StrTran := Source;
end
yes i did and i need to update it again.I have that file open on one monitor whenever I'm working on an MPL.
It's a great resource! :)
Is that natively in MPL? Or do we have to define it?
Sysop: | Kurt Weiske |
---|---|
Location: | Aptos, CA |
Users: | 158 |
Nodes: | 6 (0 / 6) |
Uptime: | 91:03:13 |
Calls: | 9,941 |
Files: | 12,143 |
D/L today: |
2 files (90K bytes) |
Messages: | 139,743 |