Delphi-PRAXiS
Seite 20 von 53   « Erste     10181920 212230     Letzte »    

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Klatsch und Tratsch (https://www.delphipraxis.net/34-klatsch-und-tratsch/)
-   -   Eure besten Quellcode Kommentare... (https://www.delphipraxis.net/96226-eure-besten-quellcode-kommentare.html)

sirius 23. Feb 2010 20:29

Re: Eure besten Quellcode Kommentare...
 
@himi: kleines Beispiel gefällig ;)
Delphi-Quellcode:
type
  IIntf=interface
  ['{7BB6E49F-7606-47BB-B894-774D91F5FE17}']
    procedure sayHallo;
    procedure sayWorld;
  end;

  TIntfClass=class(TInterfacedObject,IIntf)
    procedure sayHallo;
    procedure sayWorld;
  end;

  IIntf2=interface //gleiche IID; gehört ja normalerweise in ein anderes Modul
  ['{7BB6E49F-7606-47BB-B894-774D91F5FE17}']
    procedure sayWorld;
    procedure sayHallo;
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

{ TIntfClass }

procedure TIntfClass.sayHallo;
begin
  showmessage('Hallo');
end;

procedure TIntfClass.sayWorld;
begin
  showmessage('World');
end;

procedure TForm1.Button1Click(Sender: TObject);
var Intf2:IIntf2;
begin
  Intf2:=TIntfClass.create as IIntf2;
  Intf2.sayHallo;
  Intf2.sayWorld;
end;

himitsu 26. Feb 2010 10:37

Re: Eure besten Quellcode Kommentare...
 
OK, dann ist wenigstens der Zugriff schneller ... na dann hatte ich ja noch Glück, daß ich dadurch noch keine Probleme bekommen hab. :shock:


Delphi-Quellcode:
{ fu** Intel > BT [EAX + DH * 32], DL }
MOV    ECX, EDX
SHR    ECX, 3
AND    ECX, -$1F
//AND  EDX, $FF
BT     [EAX + ECX], EDX

Neutral General 26. Feb 2010 10:45

Re: Eure besten Quellcode Kommentare...
 
@himitsu: Verstehe deinen letzten Post nicht..

Falls sich jmd. darüber aufgeregt hat, dass

BT [EAX + DH * 32], DL

nicht geht, dann darf er aber die Schuld nicht Microsoft geben, sondern den Erfindern und Herstellern der x86-CPUs :-P

himitsu 26. Feb 2010 10:51

Re: Eure besten Quellcode Kommentare...
 
Ups, ja, ich meinte den einen Prozessorhersteller ... das M$ war da wohl irgendwie falschgedacht. :oops:


Aber ich war einfach nur sauer/beleidigt, daß es nicht geht ... da setzte dann wohl das Hirn etwas aus :?


PS: Wenn das ginge, dann könnte man Delphi nativ 64k-große SETs beibringen. :angel2:

Daniela.S 5. Mär 2010 18:47

Re: Eure besten Quellcode Kommentare...
 
Delphi-Quellcode:
(*** Was hab ich mir damals dabei gedacht? Egal, es funktioniert. Besser nicht angreifen!!! ***)

Muellermilchtrinker 22. Apr 2010 18:46

Re: Eure besten Quellcode Kommentare...
 
hatten wir schon aber egal:

Delphi-Quellcode:
try
  {...}
except
  //schluck den Fehler ^^
end;

Die Muhkuh 25. Apr 2010 17:14

Re: Eure besten Quellcode Kommentare...
 
Gerade in nem Wordpress-Theme gefunden:

Code:
<?php endif; // if you delete this the sky will fall on your head ?>

Teekeks 5. Jul 2010 19:36

AW: Eure besten Quellcode Kommentare...
 
Gerade im Lazarus Quellcode gefunden:
Delphi-Quellcode:
    {$ifndef windows} // unix
{...}
{$else}
{...}
{$endif}
Ich würde mal sagen... sehr direkt :)

blackfin 5. Jul 2010 21:57

AW: Eure besten Quellcode Kommentare...
 
Aus dem GLScene Source: :D

Delphi-Quellcode:
// a function returning some integer based on the root^exponant concept,
// result is crap and is only for "random" usage... eg perlin.
function ExponateCrap(root, exponant : Integer) : Integer;
Delphi-Quellcode:
Result := 1.0 - X / 1073741824.0 // make it a [-1;1] affair!
Delphi-Quellcode:
{: Damping applied to rotation speed (yuck!).<br>
Well, this one is not "exact", like TranslationDamping, and neither
it is "physical" since I'm reusing the mass and... and... well don't
show this to your science teacher 8).<br>
Anyway that's easier to use than the realworld formulas, calculated
faster, and properly used can give a good illusion of reality. }
property RotationDamping : TGLDamping read FRotationDamping write SetRotationDamping;

H4ndy 6. Jul 2010 15:21

AW: Eure besten Quellcode Kommentare...
 
Vor geraumer Zeit in einem historisch gewachsenem Projekt beim Ausmisten gefunden. Ich liebe Debug-Code :mrgreen:
Delphi-Quellcode:
{$IFDEF scheisse}
ShowMessage('scheisse!');
{$ENDIF}


Alle Zeitangaben in WEZ +1. Es ist jetzt 13:41 Uhr.
Seite 20 von 53   « Erste     10181920 212230     Letzte »    

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz