0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

C++ Builder 10.2 Tokyo > 文字列リテラル > 255文字制限は撤廃されている (XE4から10.2 Tokyoへの移行)

Last updated at Posted at 2017-12-28
動作環境
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();
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?