|
|
|
|
|
- Using StringBuild in multilingual applications
StringBuild (Function) In french: ChaîneConstruit Builds a character string from an initial string and parameters.
MaChaîne1 is string
MaChaîne1 = "Le fichier %1 ne peut pas être ouvert par " + ...
"l'utilisateur %2. Le fichier %1 n'est pas accessible."
MonRésultat is string = ChaîneConstruit(MaChaîne1, "Exemple", "Tintin")
MaChaîne1 is string
MaChaîne1 = "Le fichier %1 ne peut pas être ouvert par " + ...
"l'utilisateur %2. Le fichier %1 n'est pas accessible."
MonTableau is array of 1 string
MonTableau[1] = "Exemple"
MonTableau[2] = "Tintin"
MonRésultat is string = ChaîneConstruit(MaChaîne1, MonTableau)
MonRésultat is string = ChaîneConstruit(MaChaîne1, ["Exemple","Tintin"])
Syntax
Building a string from parameters Hide the details
<Result> = StringBuild(<Initial string> [, <Parameter 1> [... [, <Parameter N>]]])
<Result>: Character string Result string: the characters %X have been replaced by the indicated parameters. <Initial string>: Character string Character string containing optional parameters (%1 to %n). To display the % character in the <Result> string, it must be typed twice (%%). <Parameter 1>: Optional character string First parameter that will be inserted into the formatted character string. <Parameter 1> will replace the %1 character, <Parameter 2> will replace the %2 character, etc. The number of specified parameters must be equal to or greater than the number of parameters used in <Initial string>. If <Initial string> contains more parameters, the additional parameters will be replaced with empty strings. <Parameter N>: Optional character string Nth parameter that will be inserted into the formatted character string. <Parameter 1> will replace the %1 character, <Parameter 2> will replace the %2 character, etc. The number of specified parameters must be equal to or greater than the number of parameters used in <Initial string>. If <Initial string> contains more parameters, the additional parameters will be replaced with empty strings.
Building a string from parameters stored in an array Hide the details
<Result> = StringBuild(<Initial string> [, <Array of parameters>])
<Result>: Character string Result string: the characters %X have been replaced by the indicated parameters. <Initial string>: Character string Character string containing optional parameters (%1 to %n). To display the % character in the <Result> string, it must be typed twice (%%). <Array of parameters>: Array Name of the one-dimensional array containing the parameters to insert into the formatted character string. The first element in the array will replace the %1 character, the second element in the array will replace the %2 character, etc. The number of elements in the array must be equal to or greater than the number of parameters used in <Initial string>. If <Initial string> contains more parameters, the additional parameters will be replaced with empty strings.Note: It is also possible to pass the array directly as a parameter using the notation: <Elément 1>, ..., <Elément N> Remarks Using StringBuild in multilingual applications If your application contains messages in multiple languages, StringBuild replaces the optional characters in all supported languages. For example:
Related Examples:
|
Unit examples (WINDEV): Complex strings
[ + ] Implementing the building of complex strings with StringBuild.
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|