I see some procedures/functions having 'Wrap' at the end of them. Is there any reason for this?
An example being most of these:
http://docs.villavu.com/simba/scriptref/tpa.html#tpafromboxwrapThanks for any help. :)
Daniel
2012-03-20 02:04:59
Basically what that means is that it puts the result in a variable parametre in the parenthesis.
e.g:
http://docs.villavu.com/simba/scriptref/tpa.html#tpafromboxwrap
var
Box: TBox;
...
TPAFromBoxWrap(Box, Result);
instead of:
var
Box: TBox;
...
Result := TPAFromBox(Box);
Ah, I see! Thank you very much for explaining that, I really appreciate it.
So instead of having it return the result with a function, it uses just a parameter to do it. That's very interesting. But is there an increase in speed over using the regular functions? Or is it just better practice to use wrap procedures instead?
Thanks in advance.
masterBB
2012-03-20 11:02:03
There is no advantage. Sometimes it just looks better. And very rarely you want it to be procedure instead of a function.
Daniel
2012-03-22 01:28:05
From: masterBB
There is no advantage. Sometimes it just looks better. And very rarely you want it to be procedure instead of a function.
Technically it would be faster. Although very,
very minute.
Flight
2012-03-22 01:34:13
I didn't know this either. Thanks for the quick summery Daniel. Have some rep noob.
In my eyes it's a bit useless, but atleast I'll know the meaning anyways.