Jump to content

Difference between _Myfunction($parm) and Call("MyFunction", $parm)?


 Share

Recommended Posts

Well, with all due respect, if I am asking, it's because I don't now :D

I would tend to think that there are no difference, except maybe how fast the instruction is run, but this is just a guess. That is mostly why I am asking, I did not manage to find any answer in the autoit help or in this forum (which does not mean that it is not there, I might just have used the wrong keywords).

Link to comment
Share on other sites

  • Developers

Simple rule of thumb is never to use Call() unless you need to perform a Func of which the name is the value of a variable.

So, yes they are the same but don't use Call().

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

The helpfile does mention it "somewhat" in the page about Call().

Call

--------------------------------------------------------------------------------

Calls a user-defined function contained in a string parameter.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

If I may give a constructive comment, this is not very clear :D

It is not mentioned that it is better to use something like _Myfunction($parm)

This is not at all a complain, I absolutely love AutoIt and I cannot thank enough all of those who contributed to make this tool so great. I don't know any other free program for Window that is as powerful as AutoIt. And I also cannot thank enough the AutoiIt community here for helping us out so much.

Edited by Akshay07
Link to comment
Share on other sites

  • Moderators

Ashkay07,

this is not very clear

Nothing personal, but the Help file describes Call quite clearly:

Call - Calls a user-defined function contained in a string parameter

And the overwhelming majority of examples in the Help file use this form of function call:

_Main()

Func _Main()

So it requires a real effort to decide to use Call as a default for calling functions. However, you are not entirely alone as we do get the odd query about it - and that is not playing with words before you ask! :D

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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...