Sign in to follow this  
Followers 0
Dirk98

Please explain DIM

5 posts in this topic

Can any kind sole explain what is DIM, variable, constant and array to me? I don't understand the short explanation and examples in the Help. Or do you know a resource where I can get myself some education in these concepts? But since I'm not going to plunge too deep, I would very much appreciate if you give your everyday understanding of them. Many thanks!

Dirk. :)

Share this post


Link to post
Share on other sites



Dirk, I'd suggest using Google... To be honest, it would take a lot of work to try and explain each of those to your understanding.

Thank goodness for you that there have people on the forum that have taken their valuable time to make it easier on those that don't understand as much as they could or should.

http://www.autoitscript.com/forum/index.ph...c=19434&hl=

http://www.autoitscript.com/forum/index.php?showtopic=21048

Take a look at these, one is a "newb so to speak" tutorial, the other is an interactive one.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Can any kind sole explain what is DIM, variable, constant and array to me? I don't understand the short explanation and examples in the Help. Or do you know a resource where I can get myself some education in these concepts? But since I'm not going to plunge too deep, I would very much appreciate if you give your everyday understanding of them. Many thanks!

Dirk. :)

Though the Helpfile and the tutorials smoke gave you should help, I'll try explaining.

There are 3 main ways to define a variable.

  • Global
  • Local
  • Dim
Global - A variable defined as "global" can be referenced from anywhere in the script. It can be changed or re-defined at any time.

Local - Variable defined as "local" only exist in functions that they are created in. If they are created outside of any function, they are treated as global.

Dim - Dim basically is just a combination of Global and Local. It will declare a variable as local, unless it already exists as a global variable.

Now I will give you some examples.

Global -

;Globals can be referenced anywhere.
Global $foo = "Green"

Msgbox(0,"Outside of the function",$foo)
test()

Func Test()
Msgbox(0,"Inside of the function",$foo)
EndFuncoÝ÷ Ù²èq©m«­¢+ÙÑÍÐ ¤()Õ¹QÍÐ ¤)1½°ÀÌØí½¼ôÅÕ½ÐíɸÅÕ½Ðì)5ͽà À°ÅÕ½Ðí%¹Í¥½Ñ¡Õ¹Ñ¥½¸ÅÕ½Ðì°ÀÌØí½¼¤)¹Õ¹()5ͽà À°ÅÕ½Ðí=ÕÑÍ¥½Ñ¡Õ¹Ñ¥½¸ÅÕ½Ðì°ÀÌØí½¼¤

Perhaps that will clear some things up?

Share this post


Link to post
Share on other sites

Sincere thank you, guys. I don't know if I ever dig this science, but I'll do my due diligence on it.

Share this post


Link to post
Share on other sites

something else to know about Dim

if you have your script checked for warnings for example put the following at the top of your script:

#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6oÝ÷ Û*.Â)eëmçèZ0xºÚ"µÍÐTSÎ ÌÎNÑ[IÌÎNÈXØ]YÈXÛ][ÛYÈÙHØØ[ÜÛØ[

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0