Thema: Delphi {$X-} Result abfragen

Einzelnen Beitrag anzeigen

Benutzerbild von jfheins
jfheins

Registriert seit: 10. Jun 2004
Ort: Garching (TUM)
4.579 Beiträge
 
#2

AW: {$X-} Result abfragen

  Alt 29. Mär 2011, 14:07
Ich zitiere mal die Doku:
Zitat:
But Result is not completely interchangeable with the function name. When the function name appears on the left side of an assignment statement, the compiler assumes that it is being used (like Result) to track the return value; when the function name appears anywhere else in the statement block, the compiler interprets it as a recursive call to the function itself. Result, on the other hand, can be used as a variable in operations, typecasts, set constructors, indexes, and calls to other routines.

If the function exits without assigning a value to Result or the function name, then the function's return value is undefined.
Zitat:
Irgendwie muss man doch da dran kommen, ohne wieder {$X+} zu schalten
Nein, geht nicht. Schreibe den Code um, der es ausgeschaltet hat
  Mit Zitat antworten Zitat