Rex Posted February 12, 2017 Share Posted February 12, 2017 Hi Sry if there is an answer somewhere in the help file or in som other post at the forum (I did a search but didn't find any though), and the help file only tells me how to use the Call not if it's better, faster, simpler that the "standard" way. Is there any benefit by using call function, $par over just use the func($par) I have seen som snipets that uses the call function rather than use the function($par) Cheers /Rex Link to comment Share on other sites More sharing options...
jguinch Posted February 12, 2017 Share Posted February 12, 2017 (edited) For me, Call has to be used in the case where you don't know in advance the function name to call (when the function name is stored in a variable as string for example). For example, I used Call in _MultiProcess UDF : the function _MultiProcess_SetOnEvent allows the programmer to set a function name to call when a special event appears. Here, the function name is stored in a variable as string, so Call seems suitable. Edited February 12, 2017 by jguinch Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
JohnOne Posted February 12, 2017 Share Posted February 12, 2017 Since functions are now first class objects, using Call may very well be obsolete. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Rex Posted February 12, 2017 Author Share Posted February 12, 2017 4 hours ago, jguinch said: For me, Call has to be used in the case where you don't know in advance the function name to call (when the function name is stored in a variable as string for example). For example, I used Call in _MultiProcess UDF : the function _MultiProcess_SetOnEvent allows the programmer to set a function name to call when a special event appears. Here, the function name is stored in a variable as string, so Call seems suitable. For that I see the idea, but the snip I saw the call in it was just Call(Functionname, 'par') where I would had used FunctionName('par') Cheers /Rex Link to comment Share on other sites More sharing options...
Rex Posted February 12, 2017 Author Share Posted February 12, 2017 16 minutes ago, JohnOne said: Since functions are now first class objects, using Call may very well be obsolete. Still the way jguinch use the Call makes sense. Cheers /Rex Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now