Einzelnen Beitrag anzeigen

fisipjm

Registriert seit: 28. Okt 2013
251 Beiträge
 
#7

AW: komisches Verhalten mit OleVariant

  Alt 22. Jul 2022, 16:50
Bei Delphi sind Integer und Bool aber per default nach ihrer deklaration immer 0 bzw false.
Das gilt nur für globale Variablen und Felder einer Klasse. Einfache lokale Variablen (also keine string, interface oder so) werden nicht initialisiert.

Variables (Delphi)

Zitat:
If you do not explicitly initialize a global variable, the compiler initializes it to 0. Object instance data (fields) are also initialized to 0. The contents of a local variable are undefined until a value is assigned to them.
Aha, das war das Problem. Danke. Seltsam das da ein Unterschied zwischen global und local gemacht wird....
  Mit Zitat antworten Zitat