<?xml version="1.0" encoding="ISO-8859-1" ?>
<Template nom="StrReplace" desc='&#x0A;First argument: String with text to replace&#x0A;Second argument: Text to replace&#x0A;Third argument : New text&#x0A;&#x0A;New text is stored inside StrReplaceResult scene variable.&#x0A;Be careful not to call the function with the &quot;New text&quot; argument containing inside it &quot;Text to replace&quot; argument ( It will result in an infinite loop ).' param1="" param2="" param3="" param4="" param5="" param6="" param7="" param8="">
    <Events>
        <Event disabled="false" useCallerContext="false">
            <Type value="Function::Function" />
            <Name value="StrReplace" />
            <Conditions />
            <Actions>
                <Action>
                    <Type value="ModVarSceneTxt" loc="true" />
                    <Parametre value="" />
                    <Parametre value="StrReplaceResult" />
                    <Parametre value="Function::Parameter(0)" />
                    <Parametre value="=" />
                </Action>
            </Actions>
            <Events>
                <Event disabled="false">
                    <Type value="BuiltinCommonInstructions::While" />
                    <WhileConditions>
                        <Condition>
                            <Type value="Egal" loc="true" Contraire="false" />
                            <Parametre value="StrFind(VariableString(StrReplaceResult),Function::Parameter(1))" />
                            <Parametre value="-1" />
                            <Parametre value="!=" />
                        </Condition>
                    </WhileConditions>
                    <Conditions />
                    <Actions>
                        <Action>
                            <Type value="ModVarSceneTxt" loc="true" />
                            <Parametre value="" />
                            <Parametre value="StrReplaceResult" />
                            <Parametre value="SubStr(VariableString(StrReplaceResult), 0, StrFind(VariableString(StrReplaceResult), Function::Parameter(1)))+Function::Parameter(2)+SubStr(VariableString(StrReplaceResult), StrFind(VariableString(StrReplaceResult), Function::Parameter(1))+StrLength(Function::Parameter(1)), StrLength(VariableString(StrReplaceResult)))" />
                            <Parametre value="=" />
                        </Action>
                    </Actions>
                </Event>
            </Events>
        </Event>
    </Events>
</Template>
