I'm working with Rad Studio, c++ builder. The size of the AnsiString size is ~2^31 characters. How should I check the length?
if(ExportFileName.Length() > ??? )
{
ExportFileName. ???
}
m_ActionsHelper.LastPdfFile = ExportFileName;
I'm working with Rad Studio, c++ builder. The size of the AnsiString size is ~2^31 characters. How should I check the length?
if(ExportFileName.Length() > ??? )
{
ExportFileName. ???
}
m_ActionsHelper.LastPdfFile = ExportFileName;
Copyright © 2021 Jogjafile Inc.
As I see it in the reference, both parameters of
Deleteareint, which maximum value way lower than2^31. It seems you don't need such a check.Anyway, if you'd like to get integer power of
2, you can use binary shift operator:Binary shift operator manipulates bits of integer in such a way that all bits are shifted in the required direction. For example,
And so on. So
1ull << 31is2^31.ullmeans we use 64-bits number, becauseintis to small for it.To delete the surplus tail using Delete it should be like
or
And probably you don't need to check the length beforehand. Just
DeleteorSetLength. If it already satisfies, no action will be performed.