I would like to program productive and keep my FileSize very small. However I would like to know a few tips how do accomplish that.
举例来说,小案卷越好:
分别:
if .... = 1 then begin
...
end;
或
if ..... = inttostr(1) then begin
...
end;
或
if .... = inttostr($0001) then begin
...
end;
或
case of intvar
1: ...
2: ...
end;
Then there is something that I tried and I was surprised. I made another Unit in my project that stores Strings as constants and then I use the constant vars to replace the strings in my project. For some reason this raises my FileSize although I replace double used Strings as a var now.
Also is it better to store stuff in vars than put them directly into the code?! For example:
Function1(param1, param2, param3); // this code is used about 20 times in my project
如果我:
Avar = Function1 (param1,param2,param3); // Store this once in a var and then replace it
关于:
if ... = TRUE
或
if ....
如下:
if .... = FALSE
或
if not(...)...
为较小的档案制作节目的任何其他渠道?
提前感谢。
I use Delphi7