Page 1 of 1

delete a style

Posted: Thu Oct 11, 2007 12:03 pm
by Usch Wildt
Hi,

I want to delete Text- and ParaStyles.

In the online help it says about TFontInfos.Delete:
"Obsolete, please do not use.
In order to delete i-th item from text styles, use
TRVStyle.TextStyles.Free"

But is that also correct for BCB6?
TextStyles->Delete(i) and ParaStyles->Delete(i) seem to work fine, but
Free causes an access violation every time.

Thanks for help,

Usch Wildt

Posted: Thu Oct 11, 2007 2:42 pm
by Sergey Tkachenko
There is a mistake in the help file, this method was removed already (it was in very old version).
New versions of Delphi/Builder have this method in collection by default.

Code: Select all

TextStyles->Delete(i)
is the same as

Code: Select all

TextStyles->Items[i]->Free();
(and almost the same as

Code: Select all

delete TextStyles->Items[i];
)