動作環境
RAD Studio 10.2 Tokyo Update 2
c++ builder XE4 > エラー > 長すぎたため切り捨てられた行があります。. > 3200文字はだめ > 文字列リテラル255文字制限
XE4では255文字での制限がかかっていた。
10.2 Tokyo + Windows 10 Proだとどうなるか試した。
3500程度の文字列をstatic const Stringで定義してみたが、問題なかった。
TMemoに代入して、クリップボードにコピーする処理で問題がなかった。
Unit1.cpp
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
static const String kDummyText =
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
"1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890""1234567890"
;
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
ShowMessage(kDummyText);
Memo1->Lines->Add(kDummyText);
Memo1->SelectAll();
Memo1->CopyToClipboard();
}