vault backup: 2025-07-22 10:39:09
This commit is contained in:
@ -661,4 +661,45 @@ end.
|
|||||||
|
|
||||||
此外,脚本必须放在 **按钮** 的 **单击执行** 中
|
此外,脚本必须放在 **按钮** 的 **单击执行** 中
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
## 获取当前日期拼接到字符串中
|
||||||
|
|
||||||
|
获取当前的日期,并以 `yyyy-mm-dd` 的格式拼接到字符串末尾
|
||||||
|
|
||||||
|
```delphi
|
||||||
|
uses MyClass,Variables,BaseUtil,CommonFunc,DataConst,CFFrm,CFSimplePropFrm,Forms,StdCtrls,Variants,SysUtils,Classes,Controls,Dialogs,
|
||||||
|
CHostIntf,ProductClas,DocClas,LoginClas,VirtualTrees,CEntClas,PathClas;
|
||||||
|
|
||||||
|
var
|
||||||
|
TempStr: string;
|
||||||
|
begin
|
||||||
|
TempStr := '';
|
||||||
|
|
||||||
|
if fedtusr_lb.Text <> '' then
|
||||||
|
begin
|
||||||
|
TempStr := TempStr + fedtusr_lb.Text;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if fedtusr_KHMC.Text <> '' then
|
||||||
|
begin
|
||||||
|
if TempStr <> '' then
|
||||||
|
TempStr := TempStr + '-'; // 添加分隔符
|
||||||
|
TempStr := TempStr + fedtusr_KHMC.Text;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if fedtusr_khth.Text <> '' then
|
||||||
|
begin
|
||||||
|
if TempStr <> '' then
|
||||||
|
TempStr := TempStr + '-'; // 添加分隔符
|
||||||
|
TempStr := TempStr + fedtusr_khth.Text;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// 替换为当前时间(总是添加)
|
||||||
|
if TempStr <> '' then
|
||||||
|
TempStr := TempStr + '-'; // 添加分隔符
|
||||||
|
TempStr := TempStr + FormatDateTime('yyyy-mm-dd', Now); // 使用日期格式
|
||||||
|
|
||||||
|
fedtFShtName.Text := TempStr; // 直接赋值
|
||||||
|
end.
|
||||||
|
```
|
Reference in New Issue
Block a user