Mistři v programování na #hovnokod

Proč to dělat jednoduše, když to jde složitě :D

function FindInList(const AName: string): pointer;
begin
   case CompareNames(AName) of
   -1: result:= nil;
    0: result:= FBuildings.Items[CompareNames(AName)];
    1: result:= FBuildings.Items[CompareNames(AName)];
    2: result:= FBuildings.Items[CompareNames(AName)];
    3: result:= FBuildings.Items[CompareNames(AName)];
    4: result:= FBuildings.Items[CompareNames(AName)];
    5: result:= FBuildings.Items[CompareNames(AName)];
    6: result:= FBuildings.Items[CompareNames(AName)];
   end;
end;

function CompareNames(AName : string) : integer;
begin
 if AName='' then result := -1;
 if AName='string0' then result:= 0;
 if AName='string1' then result := 1;
 if AName='string2' then result := 2;
 if AName='string3' then result := 3;
 if AName='string4' then result := 4;
 if AName='string5' then result := 5;
 if AName='string6' then result := 6;

end;

Anonymous,

for i:=sk[(npl-1)*5+1] to sk[(npl-1)*5+2]-1 do
   begin
   l1:=0;l2:=0;l3:=0;l4:=0;l5:=0;l6:=0;l7:=0;l8:=0;l9:=0;l10:=0;
  for j:=1 to 100 do g1[j]:=0;
   for k:=sk[(npl-1)*5+1] to sk[(npl-1)*5+2] do
     if (k<>i )and
   (((abs(xyz^[pxyz^[i]].x-xyz^[pxyz^[k]].x)< dd) or  ((lx-abs(xyz^[pxyz^[i]].x-xyz^[pxyz^[k]].x))<dd))
   and ((abs(xyz^[pxyz^[i]].y-xyz^[pxyz^[k]].y)<dd) or  ((ly-abs(xyz^[pxyz^[i]].y-xyz^[pxyz^[k]].y))<dd))
   and ((abs(xyz^[pxyz^[i]].z-xyz^[pxyz^[k]].z)<dd) or  ((lz-abs(xyz^[pxyz^[i]].z-xyz^[pxyz^[k]].z))<dd)))
   then

Anonymous,


Anonymous,

Tak tohle je nejdelší identifikátor (53 znaků), co jsem kdy viděl: NormalizedSumOfWeightCompensatingSamplingIrregularity

NormalizedSumOfWeightCompensatingSamplingIrregularity:=SumOfWeightCompensatingSamplingIrregularity*weight.Count/s;
 {prima umera: ?=Swc*N/s}

Anonymous,

Jak uvolnit pole objektů. :OP

if L_SQLDatabaze[L_SQLDatabaze.Count] <> nil then
  L_SQLDatabaze[L_SQLDatabaze.Count].Free;

Ondřej Grim,