AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Object-Pascal / Delphi-Language boolean function: muss result := false gesetzt werden?
Thema durchsuchen
Ansicht
Themen-Optionen

boolean function: muss result := false gesetzt werden?

Ein Thema von JanWe · begonnen am 1. Dez 2022 · letzter Beitrag vom 2. Dez 2022
 
mjustin

Registriert seit: 14. Apr 2008
3.010 Beiträge
 
Delphi 2009 Professional
 
#4

AW: boolean function: muss result := false gesetzt werden?

  Alt 1. Dez 2022, 20:29
Lokale Variablen mit Referenzzählung werden immer mit nil (oder '') initialisiert. Alle anderen muss man selber initialisieren.

Zitat:
Local reference-counted* variables are always initialized to nil or '';
https://stackoverflow.com/a/132770/80901


Barry Kelly schrieb dazu:
Zitat:
Local variables are initialized as if they were passed to the Initialize routine. The Initialize routine uses runtime type-info (RTTI) to zero-out fields (recursively - if a field is of an array or record type) and arrays (recursively - if the element type is an array or a record) of a managed type, where a managed type is one of:

AnsiString
UnicodeString
WideString
an interface type (including method references)
dynamic array type
Variant
https://stackoverflow.com/a/861178/80901
Michael Justin
habarisoft.com

Geändert von mjustin ( 1. Dez 2022 um 20:45 Uhr)
  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 11:18 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