From 60c2899aa3c1387a75e3342d996e442fc05972b1 Mon Sep 17 00:00:00 2001 From: SPCLoong <479066371@qq.com> Date: Mon, 16 Jun 2025 12:30:37 +0800 Subject: [PATCH] vault backup: 2025-06-16 12:30:36 --- .../相关操作/4.0-other/999.Delphi脚本记录.md | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/SanPinPLM/相关操作/4.0-other/999.Delphi脚本记录.md b/SanPinPLM/相关操作/4.0-other/999.Delphi脚本记录.md index ba64d346..d52caa80 100644 --- a/SanPinPLM/相关操作/4.0-other/999.Delphi脚本记录.md +++ b/SanPinPLM/相关操作/4.0-other/999.Delphi脚本记录.md @@ -493,3 +493,34 @@ end. ## 转换了一下连接字符 +当要设置自定义分隔符号,要将==**StringList.Delimiter := '-'; // 设置分隔符为分号 + + + +uses MyClass,Variables,BaseUtil,CommonFunc,DataConst,CFFrm,CFSimplePropFrm,Forms,StdCtrls,Variants,SysUtils,Classes,Controls,Dialogs, + CHostIntf,ProductClas,DocClas,LoginClas,VirtualTrees,CEntClas,PathClas; +var + StringList: TStringList; + +begin + // 创建和初始化TStringList + StringList := TStringList.Create; + try + if fedtusr_KHMC.Text <> '' then + StringList.Add(fedtusr_KHMC.Text); + if fedtusr_khth.Text <> '' then + StringList.Add(fedtusr_khth.Text); + if fedtusr_lb.Text <> '' then + StringList.Add(fedtusr_lb.Text); + +==**StringList.Delimiter := '-'; // 设置分隔符为分号**== + // 转换为逗号分隔的字符串 + fedtFShtName.Text := StringList.DelimitedText; // 默认使用逗号作为分隔符 + + // 如果需要指定其他分隔符,可以设置Delimiter属性 + + // Result := StringList.DelimitedText; + finally + StringList.Free; + end; +end. \ No newline at end of file