新手基础疑惑
一游 2009-05-01 09:10:21 1.可以直接在一个单元中写上类似代码
unit Uoperite;
interface
uses
Classes, SysUtils;
implementation
Function Cjt_AddtoFile(SourceFile,TargetFile:string): Boolean ;
begin
实现代码
end;
意思是说,不在这里声明类,可以这样写,如果可以,那么在其它单元中如何调用;
2.如果在这里加上类声明
uses
Classes, SysUtils;
type
tt=class
private
public
end;
implementation
那么他下面的函数实现方式会变一点
Function tt.Cjt_AddtoFile(SourceFile,TargetFile:string): Boolean ;//加上属于哪个类
begin
实现代码
end;
同样,在其它的单元中如何调用
3.
public
private 可不可以出现在implementation前介不出现在类中