vault backup: 2025-09-03 11:36:58
This commit is contained in:
@ -873,4 +873,25 @@ end.
|
||||
|
||||
## 从文档名称中获取文件编码
|
||||
|
||||
设置从文件名称中获取文件编码,需要设置在
|
||||
设置从文件名称中获取文件编码,需要设置在 **事件脚本** → **页面显示时** 当中,以 `&` 符号作为分隔符
|
||||
|
||||
```delphi
|
||||
uses MyClass,Variables,BaseUtil,CommonFunc,DataConst,CFFrm,CFSimplePropFrm,Forms,StdCtrls,Variants,SysUtils,Classes,Controls,Dialogs,
|
||||
CHostIntf,ProductClas,DocClas,LoginClas,VirtualTrees,CEntClas,PathClas;
|
||||
var
|
||||
AmpPos: Integer;
|
||||
ResultText: string;
|
||||
begin
|
||||
// 查找 & 符号的位置
|
||||
AmpPos := Pos('&', fedtDocName.Text);
|
||||
|
||||
if AmpPos > 0 then
|
||||
begin
|
||||
// 提取 & 符号之前的内容
|
||||
ResultText := Copy(fedtDocName.Text, 1, AmpPos - 1);
|
||||
|
||||
// 将变量值插入SQL语句,而不是变量名
|
||||
chiExecuteSqlNoResultRec('update cfdoc set code = ''' + ResultText + ''' where docid = ' + IntToStr(CurBizObj.objid));
|
||||
end;
|
||||
end.
|
||||
```
|
Reference in New Issue
Block a user