-
Delphi Const
What difference does it make when I use a const parameter in a procedure? Take the following procedure for example: procedure DoSomething(Sender: TObject; const Text: String; var Reply: String); begin //Text is read-only and Reply will be passed back wherever DoSomething was called Reply:= Text; end; The parameter Text: String is prefixed with const so that (as far as I know), a copy of the value is made and used - and is read-only. What I was wondering is how is does this affect the application any differently than if I didn't put const there? Perhaps a performance trick? FWIW: for how it is passed, it doesn't matter if a parameter is const or not. If it is not explicitly declared var or out, it will be passed the same for const or non-const. Generally, items larger than register size (say, 32 bit) will be passed by reference, no matter if they are const or not.
Fairy Tail (Sub) Episode 161 Credits to kissanime/ Hiro Mashima. Fairy tail 2014 sub kissanime.
I found out later that Delphi had so many complaints that Chris Doctor started a new construction company using a different name. If you check his license, search his name to get a list of all his companies.
The only difference between const and non-const is that for non-const, hidden code is inserted at the start that copies the item to local storage. For const, only reading references are allowed, so this copying code is missing and the passed reference is used directly. – Jun 13 '12 at 7:27.
All hail the “const” parameters! By Eric Grange / July 28, 2010 Passing parameters as “ const ” is a classic Delphi optimization trick, but the mechanisms behind that “trick” go beyond cargo-cult recipes, and may actually stumble into the “good practice” territory. Operational since 1992, Delphi Construction Inc. Has been providing constructional management services. Located in Waltham, Mass., it specializes in higher education, healthcare, industrial and corporate projects. The company has also worked on several others projects in the categories of assisted living and religion. The name Delphi comes from the same root as δελφύς delphys, 'womb' and may indicate archaic veneration of Gaia at the site. Apollo is connected with the site by his epithet Δελφίνιος Delphinios, 'the Delphinian'.