AGB  ·  Datenschutz  ·  Impressum  







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

Procedur verstehen

Ein Thema von paul.kunig · begonnen am 2. Jul 2019 · letzter Beitrag vom 3. Jul 2019
 
DieDolly

Registriert seit: 22. Jun 2018
2.175 Beiträge
 
#4

AW: Procedur verstehen

  Alt 2. Jul 2019, 19:45
Nimm das [ref] einfach weg. Ich kann mir nicht vorstellen, dass das dahin gehört.

https://pascal.today/2016/08/17/cons...-vs-non-const/
Zitat:
Const

The const parameters are almost the same as standard parameters, but have some differences. It is not allowed to set the value to the const parameter inside of the function/procedure either pass it as a var/out parameter to other routines. The const parameters are passed by value (simple types) or by reference (string, fixed array, dynamic arrays and records. However this depends on the size of the parameter. If the size of the parameter is bigger than a certain amount of bytes then it is passed by reference instead) but without copy on write – remember, those are marked read-only and we cannot assign values to them or pass them to var parameters of other routines. You can specify [Ref] before the parameter to force the compiler to pass the value by reference – so it will be the same as var parameter except that the routine cannot modify the value directly via assignment. But be warned that const [Ref] parameters cannot be captured by the anonymous methods (lambdas) – as it is with “Result” in functions.
  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 03:08 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