Binary Strings

Long strings can be used for storing binary data. Because the length of the string is not determined by searching for char #0 (it is stored outside of the string), you can use all binary data - even #0.

These long strings are ideal for binary buffers, because they are automatically allocated and deallocated from memory. By using long strings as binary buffers you can create memory-leak-free applications!

However, you have to be careful when writing your strings to the display because most graphical controls cannot display binary strings (they expect null-terminated strings).

Of course, you cannot cast this binary string to a (null-terminated) PChar.

public/howto/binarystring.txt · Last modified: 2007/11/30 14:30 (external edit)
Driven by DokuWiki Recent changes RSS feed