System.Classes.TWriter.WriteString

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure WriteString(const Value: string);

C++

void __fastcall WriteString(const System::UnicodeString Value);

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.Classes.pas
System.Classes.hpp
System.Classes TWriter

Description

Writes the string passed in Value to the writer object's stream.

WriteString is used internally by the component streaming system to write string type properties of components to the writer object's stream.

WriteString calls WriteValue to write the value-type indicator (one of the vaString, vaLString, vaWString, or vaUTF8String values) proper to the passed Value string and then calls Write to write the passed Value string data to the writer object's stream.

WriteString advances the current position after the last written byte.

Warning: Always use WriteString for writing component strings to streams. The similarly-named WriteStr and WriteUTF8Str methods are for internal use by certain components and can corrupt data if not used correctly.
Note: Please note that the vaString value type indicator applies to the ANSIString type, while the vaLString value type is for the Unicode string type, which is the alias of the string type.

See Also