v5.0 AI助手
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include <System.StrUtils.hpp>
|
||||
#include "CodesFrameUnit.h"
|
||||
//---------------------------------------------------------------------------
|
||||
#pragma package(smart_init)
|
||||
#pragma resource "*.dfm"
|
||||
TCodesFrame *CodesFrame = NULL;
|
||||
//---------------------------------------------------------------------------
|
||||
__fastcall TCodesFrame::TCodesFrame(TComponent* Owner)
|
||||
: TFrame(Owner)
|
||||
{
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TCodesFrame::SetDesc(const String& src)
|
||||
{
|
||||
m_memDesc->Lines->Clear();
|
||||
|
||||
// TStringDynArray lines = SplitString(src, L";。;:"); // 或 ";",看 String 是 UnicodeString/AnsiString
|
||||
// bool bAny = false;
|
||||
// for (int i = 0; i < lines.Length; i++){ // TStringDynArray 0-based
|
||||
// String s = lines[i].Trim();
|
||||
// if (s.Length()) {
|
||||
// m_memDesc->Lines->Add(s);
|
||||
// bAny = true;
|
||||
// }
|
||||
// }
|
||||
// if (!bAny)
|
||||
// m_memDesc->Lines->Add("该实例暂无描述");
|
||||
|
||||
String cur;
|
||||
for (int i = 1; i <= src.Length(); i++) {
|
||||
cur += src[i];
|
||||
if (src[i] == L';' || src[i] == L'。' || src[i] == L';' || src[i] == L':' ) {
|
||||
m_memDesc->Lines->Add(cur); // cur 是 AnsiString,Add 接受 String
|
||||
cur = "";
|
||||
}
|
||||
}
|
||||
|
||||
if (cur.Length())
|
||||
m_memDesc->Lines->Add(cur);
|
||||
|
||||
if (m_memDesc->Lines->Count == 0)
|
||||
m_memDesc->Lines->Add("该实例暂无描述");
|
||||
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user