StringConcatenate

Forme la chaîne des paramètres transmis et rend la grandeur de la chaîne formée. Les paramètres peuvent avoir n'importe quel type. Le nombre de paramètres ne peut pas être moins 2 et ne peut pas excéder 64.

int  StringConcatenate(
   string&  string_var,   // chaîne pour la formation
   void argument1         // premier paramètre de n'importe quel type simple 
   void argument2         // deuxième paramètre de n'importe quel type simple
   ...                    // paramètre suivant de n'importe quel type simple 
   );

Paramètres

string_var

[out]  La chaîne qui sera formée à la suite de la concaténation.

argumentN

[in]  N'importe quelles valeurs divisées par les virgules.De 2 à 63 paramètres de n'importe quel type simple.

La valeur rendue

Rend la longueur de chaîne, formée par la concaténation de paramètres transformés dans le type string. Les paramètres seront transformés en chaînes selon les mêmes règles que dans les fonctions Print() et Comment().

Example:

void OnStart()
  {
//--- declare and define variables participating in concatenation
   string text="";
   string text1="This script shows how the StringConcatenate() function works.\n";
   string text2="This is the second line, at the end of which there is a line break control code.\n";
   string text3="This is line number ";
   int    num3=3;
   string text31=", the number of which is entered into the function as a separate parameter.";
   string textN="\n";
   string text4="This is line number 4, preceded by a separate parameter with a line break code.";
   int    length=StringConcatenate(texttext1text2text3num3text31textNtext4"\nLine 5 includes a real number: "0.12345);
   Print(text"\nLength of the resulting string = "length);
   
   /*
   Result
   This script shows how the StringConcatenate() function works.
   This is the second lineat the end of which there is a line break control code.
   This is line number 3the number of which is entered into the function as a separate parameter.
   This is line number 4preceded by a separate parameter with a line break code.
   Line 5 includes a real number0.12345
   Length of the resulting string = 358
   */
  }

Voir aussi

StringAdd, StringSplit, StringSubstr