Get indexed string with parameters

<code 4D>

// ----------------------------------------------------
// User name (OS): madamov
// Date and time: 01/03/19, 12:16:00
// ----------------------------------------------------
// Method: XLIFF_GetIndxStrWithParams
//
// Description
//
// Returns modified indexed string from XLIFF with added
// values instead of user definable parameters. For example
// if you have this code
//
// ALERT(“Password for “+$username+” modified.”)
//
// and you want to write just one line in XLIFF file, you can do it
// by writing this string in XLIFF
//
// “Password for %1 modified.”
//
// and calling this method like
//
// ALERT(XLIFF_GetIndxStrWithParams(2001;1;"%";$username))
//
// Parameters
//
// $1 - Group ID of string in XLIFF file
// $2 - Trans unit ID of string within group id $1
// $3 - Prefix used for parameter (for example % like in
// UNIX bash)
// ----------------------------------------------------

C_LONGINT($1;$2;$xlf_group_id;$xlf_transunit_id;$i)
C_TEXT($0;$3;$param_prefix;$curr_param)
C_TEXT(${4})

$xlf_group_id:=$1
$xlf_transunit_id:=$2
$param_prefix:=$3

$0:=Get indexed string($xlf_group_id;$xlf_transunit_id)

For ($i;4;Count parameters)

$curr_param:=$param_prefix+String($i-3)

$0:=Replace string($0;$curr_param;${$i})

End for

</code 4D>