Replace, ReplaceAll equivalent in RDML

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
sotis
Posts: 14
Joined: Thu Sep 16, 2021 11:37 pm

Replace, ReplaceAll equivalent in RDML

Post by sotis » Tue Jun 06, 2023 5:01 pm

Hello,

Are there equivalent command or built-in functions to intrinsic RDMLX string functions Replace and ReplaceAll in RDML?

best,
Sotiris

User avatar
Dino
Posts: 394
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: Replace, ReplaceAll equivalent in RDML

Post by Dino » Wed Jun 07, 2023 3:41 am

Hi,

No, there is not.
https://docs.lansa.com/15/en/lansa015/i ... 1_0056.htm

but you can call from an RDML function to an RDMLX function and get the result.. like:

Code: Select all

FUNCTION OPTIONS(*DIRECT)
CHANGE #STD_TEXTL 'ABRACADABRA'
EXCHANGE #STD_TEXTL
CALL PROCESS(*DIRECT) FUNCTION(FUNX01)
DISPLAY #STD_TEXTL
and FUNX01 which needs to be an RDMLX can do something like:

Code: Select all

FUNCTION OPTIONS(*DIRECT)
#STD_TEXTL := #STD_TEXTL.ReplaceAll( 'A', 'X' )
EXCHANGE #STD_TEXTL
RETURN

Post Reply