JCL Help:StrAddRef@AnsiString

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Increments the reference count of a long string.


Pascal

 procedure StrAddRef(var S: string);
procedure StrAddRef(var S: AnsiString);


Parameters

Parameters Description
var S: string The long string whose reference count to increment.


Description

The StrAddRef routine increments the reference count of the specified long string. Explicitly incrementing a strings reference count forces Delphi to keep the string in memory even if the variable itself goes out of scope and all other references were removed already. Note that if the string points to a string constant this routine will call UniqueString on it forcing a string copy, after which the reference count becomes 1.


See Also

StrDecRef


About

Unit

JclAnsiStrings


Donator

Marcel van Brakel


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page