Results 1 to 4 of 4

Thread: pointer helper

  1. #1
    Reader
    Join Date
    May 2002
    Location
    Holland
    Posts
    3,382

    pointer helper

    Getest en dit lijkt legaal te zijn, ook bij nil :-)
    Code:
    type
      TPointerHelper = record Helper for Pointer
        function HasValue: Boolean; inline;
      end;
    
    function TPointerHelper.HasValue: Boolean;
    begin
      Result := Self <> nil;
    end;

  2. #2
    Fornicatorus Formicidae VideoRipper's Avatar
    Join Date
    Mar 2005
    Location
    Vicus Saltus Orientalem
    Posts
    5,708
    Hahahaha, ik sta nog regelmatig versteld van de verborgen trucjes die je kunt uithalen in Delphi.
    TMemoryLeak.Create(Nil);

  3. #3
    Maar inlinet ie het ook?
    1+1=b

  4. #4
    Reader
    Join Date
    May 2002
    Location
    Holland
    Posts
    3,382
    yep
    Code:
    Form.Main.pas.580: if not p.HasValue then begin
    0068DAD8 837DCC00         cmp dword ptr [ebp-$34],$00
    0068DADC 7510             jnz $0068daee
    
    Form.Main.pas.584: if p = nil then begin
    0068DAEE 837DCC00         cmp dword ptr [ebp-$34],$00
    0068DAF2 7510             jnz $0068db04

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •