PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Using StringBuild in multilingual applications
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Builds a character string from an initial string and parameters.
Example
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 = StringBuild(MaChaîne1, "Exemple", "Tintin")
// MonRésultat contient: "Le fichier Exemple ne peut pas être
// ouvert par l'utilisateur Tintin. Le fichier Exemple n'est pas accessible."
Versions 18 and later
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 = StringBuild(MaChaîne1, MonTableau)
// MonRésultat contient: "Le fichier Exemple ne peut pas être
// ouvert par l'utilisateur Tintin. Le fichier Exemple n'est pas accessible."
 
// La notation suivante est également disponible:
MonRésultat is string = StringBuild(MaChaîne1, ["Exemple","Tintin"])
New in version 18
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 = StringBuild(MaChaîne1, MonTableau)
// MonRésultat contient: "Le fichier Exemple ne peut pas être
// ouvert par l'utilisateur Tintin. Le fichier Exemple n'est pas accessible."
 
// La notation suivante est également disponible:
MonRésultat is string = StringBuild(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 = StringBuild(MaChaîne1, MonTableau)
// MonRésultat contient: "Le fichier Exemple ne peut pas être
// ouvert par l'utilisateur Tintin. Le fichier Exemple n'est pas accessible."
 
// La notation suivante est également disponible:
MonRésultat is string = StringBuild(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 %X characters have been replaced by the specified parameters.
<Initial string>: Character string (with quotes)
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 (with quotes)
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 by empty strings.
<Parameter N>: Optional character string (with quotes)
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 by empty strings.
Versions 18 and later

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 %X characters have been replaced by the specified parameters.
<Initial string>: Character string (with quotes)
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 of array will replace the character %1, the second element of array will replace the character %2, 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 by empty strings.
Remark: You can also pass an array as a parameter by using the following syntax:
<Elément 1>, ..., <Elément N>
New in version 18

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 %X characters have been replaced by the specified parameters.
<Initial string>: Character string (with quotes)
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 of array will replace the character %1, the second element of array will replace the character %2, 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 by empty strings.
Remark: You can also pass an array as a parameter by using the following syntax:
<Elément 1>, ..., <Elément N>

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 %X characters have been replaced by the specified parameters.
<Initial string>: Character string (with quotes)
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 of array will replace the character %1, the second element of array will replace the character %2, 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 by empty strings.
Remark: You can also pass an array as a parameter by using the following syntax:
<Elément 1>, ..., <Elément N>
Remarks

Using StringBuild in multilingual applications

If your application contains messages displayed in several languages, StringBuild is used to replace the optional characters in all the supported languages.
For example:
Window for entering multilingual messages
Related Examples:
Complex strings Unit examples (WINDEV): Complex strings
[ + ] Implementing the building of complex strings with StringBuild.
Component: wd260vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment