Jump to content

ew to AutoIT


Recommended Posts

Hi All, I'm a recent convert from VBScript, I have actually want to start using AutoIt before but did not have the time to devote. I really like it but I have a few questions.

Is there an equivalent to 'Option Explicit'?

Is 'Dim' the same as 'Global' if done outside of a function or sub?

What is the purpose of 'Local'?

Is there a general 'Err' object to handle errors?

Thanks!!

Edit: sorry the title was suppose to say "New to AutoIt"

Edited by Like2Code
Link to comment
Share on other sites

Opt("MustDeclareVars", 1)

From the helpfile:

The difference between Dim, Local and Global is the scope in which they are created:

Dim = Local scope if the variable name doesn't already exist globally (in which case it reuses the global variable!)

Global = Forces creation of the variable in the Global scope

Local = Forces creation of the variable in the Local/Function scope

No, you have to handle the errors yourself.

Link to comment
Share on other sites

Dim = Local scope if the variable name doesn't already exist globally (in which case it reuses the global variable!)

Note that DIM is considered bad practice. Much better to be aware of the scope you need and use only Global or Local as required.

:mellow:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...