Forum: Object-Pascal / Delphi-Language
Delphi
by Luckie,
9. Mai 2011
The result will of course be the same. But encapsulating the code makes it more readable, easier to administrate and (re)use.
Forum: Object-Pascal / Delphi-Language
Delphi
by Luckie,
9. Mai 2011
The class could look like this:
TXyz = class
private
FFile: TFileStream;
public
property XyzFile: TFileStream read FFile write FFile;
procedure AddData(...);
procedure InsertData(...);
end;
Forum: Object-Pascal / Delphi-Language
Delphi
by Luckie,
9. Mai 2011
Why is FFile global? If it is global because it is needed in different parts of the code, why don't you make a class out of the code?