PutStringToStream procedure
Return to Introduction  Previous page  Next page
Unit
acUtils  

Declaration
procedure PutStringToStream(Str: String; Stream: TStream);  

Description
The PutStringToStream procedure puts the string to stream (to current position of stream). To retrieve the string from stream — use GetStringFromStream function.  

Original code
procedure PutStringToStream(const Str: String; Stream: TStream);  
var  
  Len: DWord;  
begin  
  Len := Length(Str);  
  with Stream do  
   begin  
    Write(Len, SizeOf(Len));  
    Write(Str[1], Len);  
   end;  
end;  

See also
GetStringFromStream function.