KnowledgeBase: Conversion of an Integer Value to a Character Array

To convert an integer value to a character array and set it as string system variable, use the following CAPL Code:

   // definition of a character array buffer
  char buffer[100];
  // conversion of an integer variable to a character array
  snprintf(buffer,elcount(buffer),"%d",integervariable);
  // setting of a system variable of type string with the buffer
  sysSetVariableString(sysvar::my_string_sysvar,buffer);