<div dir="ltr"><div style>Name parameters are supported through variants. </div><div style><br></div><div style><div>procedure Test(V: Variant);</div><div>begin</div><div> V.SomeMethod(12, ParamOne := '', ParamTwo := 12.5);</div>
<div>end;</div><div> </div><div>Internally what happens is V is checked to for IDispatch, next GetIDsOfNames is called to find the dispid of SomeMethod, then a variant array of arguments is constructed (with the names), and finally Invoke is called. <br>
</div></div><div><br></div><div>This comes from the Microsoft COM concept of "automation", though automation encompasses a bit more than IDispatch, including marshalling, remoting, and error handling; passing errors back from a remote machine for example.<br>
</div><div><br></div><div style>People don't really use this stuff much anyone, nor is their much demand for people with knowledge of the inner workings of COM. But if you want, you can write your own objects which implement IDispatch.</div>
<div style><br></div><div style>See the source code in the download link on this page: <a href="http://www.codebot.org/delphi/?doc=9573">http://www.codebot.org/delphi/?doc=9573</a></div><div style><br></div><div style>ScripTools.pas class TScriptlet which exposes arbitrary pascal methods and properties to a Javascript engine.</div>
<div style><br></div></div>