AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Variablen nicht NIL 64Bit

Ein Thema von EWeiss · begonnen am 1. Sep 2018 · letzter Beitrag vom 12. Sep 2018
 
Benutzerbild von Uwe Raabe
Uwe Raabe

Registriert seit: 20. Jan 2006
Ort: Lübbecke
11.824 Beiträge
 
Delphi 12 Athens
 
#17

AW: Variablen nicht NIL 64Bit

  Alt 1. Sep 2018, 13:08
NÖ weil sie unter Delphi2010 ausgespuckt wird und nicht unter Delphi 10.2.3..
Dann compilierst du was anderes oder mehr als hier gezeigt.

Ich habe mal die nötigen GDI+ Deklarationen extrahiert, da es die unter D2010 im Standard noch nicht gibt. Dieses Programm
Delphi-Quellcode:
program Test;

type
  Status = (Ok, GenericError, InvalidParameter, OutOfMemory, ObjectBusy, InsufficientBuffer, NotImplemented, Win32Error,
    WrongState, Aborted, FileNotFound, ValueOverflow, AccessDenied, UnknownImageFormat, FontFamilyNotFound,
    FontStyleNotFound, NotTrueTypeFont, UnsupportedGdiplusVersion, GdiplusNotInitialized, PropertyNotFound,
    PropertyNotSupported);
  TStatus = Status;

  GpStatus = TStatus;

type
  GpFont = Pointer;

function GdipDeleteFont(font: GpFont): GpStatus;
begin
  Result := Ok;
end;

procedure Main;
var
  TempFont: GpFont;
begin
  TempFont := nil;

  if Assigned(TempFont) then begin
    GdipDeleteFont(TempFont);
    TempFont := nil; // H2077 Auf 'TempFont' zugewiesener Wert wird niemals benutzt
  end;
end;

begin
  Main;
end.
gibt sowohl unter D2010 als auch unter Delphi 10.2.3 nur einen Hinweis
Zitat:
H2077 Auf 'TempFont' zugewiesener Wert wird niemals benutzt
für die zweite Zuweisung von TempFont innerhalb des if-then-Blocks aus. Die erste Zuweisung auf nil wird nicht bemängelt. Die beiden Compiler arbeiten in diesem Fall also identisch und auch korrekt.
Uwe Raabe
Certified Delphi Master Developer
Embarcadero MVP
Blog: The Art of Delphi Programming
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:59 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz