OBS/Makros und Scripting/Allgemeines/Übersicht Prozeduren: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Böhrer (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „You can begin any time and energy to fix your poor credit; the quicker better. Paul Bieber an MBA economic did his master in economic. This is surely an intere…“) |
Nimz (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „{{Makros und Scripting}} Hier finden Sie nützliche [https://de.wikipedia.org/wiki/Prozedur_(Programmierung) Funktionen], die Sie in den Makros verwenden könn…“) |
||
Zeile 1: | Zeile 1: | ||
{{Makros und Scripting}} | |||
Hier finden Sie nützliche [https://de.wikipedia.org/wiki/Prozedur_(Programmierung) Funktionen], die Sie in den Makros verwenden können, um das gewünschte Ergebnis zu erzielen. | |||
=Liste der Prozeduren= | |||
==MyFreeAndNil== | |||
Definition: | |||
<syntaxhighlight lang="Delphi"> | |||
procedure MyFreeAndNil(var Obj); | |||
</syntaxhighlight> | |||
Erklärung:<br /> | |||
Schließt die Instanz eines [https://de.wikipedia.org/wiki/Objekt_(Programmierung) Objektes] und gibt den reservierten [https://de.wikipedia.org/wiki/Arbeitsspeicher Arbeitsspeicher] wieder frei. Die Objekt-Variable wird dabei auf nil ([https://de.wikipedia.org/wiki/Nullwert Nullwert] in [https://de.wikipedia.org/wiki/Embarcadero_Delphi Delphi]/[https://de.wikipedia.org/wiki/Pascal_(Programmiersprache) Pascal]) gesetzt.<br /> | |||
<br /> | |||
Beispiel: | |||
<syntaxhighlight lang="Delphi"> | |||
oBeispiel := TObject.Create(); | |||
MyFreeAndNil(oBeispiel); | |||
//oBeispiel ist jetzt nil | |||
</syntaxhighlight> |
Version vom 12. April 2019, 08:27 Uhr
Hier finden Sie nützliche Funktionen, die Sie in den Makros verwenden können, um das gewünschte Ergebnis zu erzielen.
Liste der Prozeduren
MyFreeAndNil
Definition:
procedure MyFreeAndNil(var Obj);
Erklärung:
Schließt die Instanz eines Objektes und gibt den reservierten Arbeitsspeicher wieder frei. Die Objekt-Variable wird dabei auf nil (Nullwert in Delphi/Pascal) gesetzt.
Beispiel:
oBeispiel := TObject.Create();
MyFreeAndNil(oBeispiel);
//oBeispiel ist jetzt nil