Jump to content

Call function vs function($par)


Rex
 Share

Recommended Posts

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

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 by jguinch
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...