大家好:我在UNIT中用到了一个变量,每个过程中都能用到,所以我在PRIVATE中定义了,如下unit ***;interfaceprivate abc : string;
implementationuses ....procedure.....
begin
abc := 'abcdeff';end但是这样,每一个PROCEDURE中都要写一遍abc := 'abcdeff';有没有什么办法在interface或implementation直接一次赋值吗?(不想再用一个PUBVAR单元)谢谢,在线等
implementationuses ....procedure.....
begin
abc := 'abcdeff';end但是这样,每一个PROCEDURE中都要写一遍abc := 'abcdeff';有没有什么办法在interface或implementation直接一次赋值吗?(不想再用一个PUBVAR单元)谢谢,在线等
TMyClass = class
private
FValue:string;
public
procedure ShowValue();
constructor Create;
end;implementationconstructor TMyClass.Create;
begin
FValue:='abcdefg';
end;procedure TMyClass.ShowValue();
begin
ShowMessage(FValue);
end;end.
abc: string='abcdeff';