Previous Topic Next topic Print topic


&SUBST

Holds the original string with only the first occurrence of the match string replaced by the substitute string. If the match string does not occur in the original string, &SUBST returns a copy of the original string. The original arguments remain unchanged.
Restriction: This topic applies only when the AppMaster Builder AddPack has been installed, and applies only to Windows platforms.

Syntax:

&SUBST ('originalstring', 'matchstring', 'substitutestring')

Aliases:

&subst ('originalstring', 'matchstring', 'substitutestring')
&Subst ('originalstring', 'matchstring', 'substitutestring')
&SUBSTITUTE ('originalstring', 'matchstring', 'substitutestring')
&substitute ('originalstring', 'matchstring', 'substitutestring')
&Substitute ('originalstring', 'matchstring', 'substitutestring')

Comments:

If any of the arguments are stored as a numeric type, MFG converts them to a temporary text form before performing the matching process.

Examples:

&SUBST ("ABCDEFABCDEF", "ABC", "xyz") = "xyzDEFABCDEF"
&SUBST ("ABCDEFABC", "ABC", "uvwxyz") = "uvwxyzDEFABCDEF"
&SUBST ("ABCDEFABCDEF", "ABC", "xyz") = "xyzDEFABC"
&SUBST ("ABCDEFABCDEF", "ABC", "")    = "DEFABCDEF"
&SUBST ("ABCDEFABCDEF", "", "xyz")    = "ABCDEFABCDEF"
Previous Topic Next topic Print topic