StringConcatenate

La funzione, forma una serie di parametri passati e restituisce la grandezza della stringa formata. I parametri possono essere di qualsiasi tipo. Il numero di parametri non può essere minore di 2 o più di 64.

int  StringConcatenate(
   string&  string_var,   // stringa da formare
   void argument1         // primo parametro di un qualsiasi tipo semplice
   void argument2         // secondo parametro di un qualsiasi tipo semplice
   ...                    // parametro successivo di qualsiasi tipo semplice
   );

Parametri

string_var

[out] Stringa che verrà formata come risultato della concatenazione.

argumentN

[in] Qualsiasi valore separato da virgola. Da 2 a 63 parametri di qualsiasi tipo semplice.

Valore restituito

Restituisce la lunghezza della stringa, formata dalla concatenazione di parametri trasformati in tipo stringa. I parametri vengono trasformati in stringhe secondo le stesse regole Print() e Comment().

Esempio:

void OnStart()
  {
//-- dichiarare e definire le variabili che partecipano alla concatenazione
   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);
   
  /*
  Risultato
   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
  */
  }

Vedi anche

StringAdd, StringSplit, StringSubstr