Applies To:
  • CitectSCADA 1.00, 1.01, 1.10, 1.11, 1.20, 2.00, 2.01

I have displayed a string variable on the screen and there are garbage characters attached to the end of my string. 

When a String variable is displayed, Citect will display all characters up to the null terminator. Each character in a string variable will occupy one byte, ie. two characters per Word. If you define a string that is three words long, and you put the word "Citect" in the string, the string will occupy the three words - there will be no room for the null terminator. The null terminator will occupy one byte in the string. You must always leave one byte free on the end of the string for the null terminator.

You don't normally get this problem with Cicode strings because Citect will always add the null terminator. Howeverr, this can happen if you create the string with the Cicode function StrSetChar() and you don't terminate the string.

See Also Q1002 and Q1129