jaberwacky Posted October 10, 2011 Share Posted October 10, 2011 (edited) I have noticed a couple of things that I hope are not too nitpicky. I have a history of being really nitpicky. You can do this: Global $variable1 = True If $variable1 = True Then ConsoleWrite("True" & @LF) But not this: Global $counter = 0 For $i = 0 To 9 $counter += 1 Also, this: Global Const $variable = '' But not this: Global Const $variable I'm not a computer scientist so I'm wondering what goes on behind the scenes to cause this. Discuss. Edited October 10, 2011 by LaCastiglione Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Richard Robertson Posted October 11, 2011 Share Posted October 11, 2011 For loop doesn't work because there isn't a keyword or operator terminating the statement. This is a failing point of BASIC rather than AutoIt specifically. Constants with no value make no sense. That's a failure on your part. Link to comment Share on other sites More sharing options...
jaberwacky Posted October 11, 2011 Author Share Posted October 11, 2011 I thought a constant without a value automatically = '' Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Valik Posted October 11, 2011 Share Posted October 11, 2011 What practical purpose does declaring an empty constant serve? It's constant, you can't change the value to something meaningful later. If it's empty and will always be empty (implied by it being constant) then you likely have some logic error in your code that is creating a situation where you would need an empty constant. As for the For loop, that is merely a syntactic choice. We terminate things with explicit keywords. Other languages use curly brackets. Python uses indentation, et cetera. There is minimal need for supporting single-line For statements as most For statements are not so trivial. Link to comment Share on other sites More sharing options...
jaberwacky Posted October 11, 2011 Author Share Posted October 11, 2011 Thanks Valik. Well, it serves no practical purpose. I was just wondering what variables are automatically assigned to behind the scenes. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Richard Robertson Posted October 11, 2011 Share Posted October 11, 2011 You should never rely on unassigned variables having any value. That's programming 101. Link to comment Share on other sites More sharing options...
jvanegmond Posted October 11, 2011 Share Posted October 11, 2011 For someone who is a nitpick, you missed all the things which deserve being nitpicked over. AutoIt isn't perfect, but these are definitely not its imperfections. github.com/jvanegmond Link to comment Share on other sites More sharing options...
jaberwacky Posted October 11, 2011 Author Share Posted October 11, 2011 Well, I wasn't criticizing AutoIt. AutoIt is a great language which I use daily. I was just curious is all. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
jvanegmond Posted October 11, 2011 Share Posted October 11, 2011 Well, I wasn't criticizing AutoIt. AutoIt is a great language which I use daily. I was just curious is all.I wanted to edit my post but I forgot, and doing so now means you probably wont see it. Here's what I wanted to add: I challenge you to find some things in AutoIt worth nitpicking. You were curious about syntax, so that would be my first suggestion. github.com/jvanegmond Link to comment Share on other sites More sharing options...
jaberwacky Posted October 12, 2011 Author Share Posted October 12, 2011 Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? 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