go0b3r Posted February 8, 2006 Share Posted February 8, 2006 this is from that autoit 3-2-1 tutorial program (which has helped me loads, ty to whoever made it.) this is the script #include <GUIConstants.au3> GUICreate("My GUI Button") ; will create a dialog box that when displayed is centered. Opt("GUICoordMode",2) ; this is one of many special, coordinates modes, this one is based on 2, the cell position. GUICtrlCreateButton ("OK", 10, 30, 50) ; this creates the button, the first text is what is displayed on the button. ; the second is how far from the left, the third how far from the top, fourth is how long the button is. ; this button is based on the cell coordinates, of the previous button. GUICtrlCreateButton ( "Cancel", 0, -1) GUISetState () ; will display an dialog box with the 2 buttons. ; Run the GUI until the dialog is closed. While 1 $msg = GUIGetMsg() ; this checks for a message/input from the GUI. If $msg = $GUI_EVENT_CLOSE Then ExitLoop ; this states, on an exit event, exit the loop. Wend But what does this part mean: #include <GUIConstants.au3> I see that in many scripts i look at but dont know what it means, does it run the script in combination with the one its included in? how do you know what to put there?? Link to comment Share on other sites More sharing options...
go0b3r Posted February 8, 2006 Author Share Posted February 8, 2006 also, (im kinda starting to understand what stuff means, thanks to the comments put beside the otherwise confusing scripts) if i see something like this: $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop the $msg is only used to help organize things right? it doesn't HAVE to be $msg, it could be $carrot lol. Is this right or am i still way off? Because up until now those $msg, or $whatever have been gibberish to me. Link to comment Share on other sites More sharing options...
greenmachine Posted February 8, 2006 Share Posted February 8, 2006 Anything that starts with $ is a variable. $msg is generally used for GUIGetMsg() so the user knows that the $msg variable holds info about the events the user has triggered in the GUI. $GUI_EVENT_CLOSE is a constant declared in guiconstants.au3 (the reason for the #include) - when you click on the X in the corner of the GUI, that sends the $GUI_EVENT_CLOSE msg, and your $msg variable picks that up and acts accordingly. Link to comment Share on other sites More sharing options...
DaveF Posted February 8, 2006 Share Posted February 8, 2006 But what does this part mean: #include <GUIConstants.au3> I see that in many scripts i look at but dont know what it means, does it run the script in combination with the one its included in? how do you know what to put there?? Welcome to programming, My Friend, you've got a long road through a world of hurt (and brilliance) ahead of you. Yes, #include <whatever.au3>...says to take the contents of whatever.au3 and include it in this file as if it were pasted in. Include files are properly used for code that wouldn't do anything if you ran it as a script itself, like variable declarations and function definitions. Most times when you use #include you're including a script that someone else wrote to take advantage of what's in there, you don't have to put anything yourself. A variable is just a distinctive name (like $foo; regular AutoIt variables start with $) that will save a value when you make them = to something, which usually happens several times in any script. A function, which looks like: TheFunction()...is a kind of a shorthand way of writing a section of code that you'll do more than once, maybe with different data each time. AutoIt has a lot of built-in functions like GUIGetMsg(), or you can make your own User Defined Functions (UDFs). Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines. Link to comment Share on other sites More sharing options...
flaxcrack Posted February 8, 2006 Share Posted February 8, 2006 But what does this part mean:#include <GUIConstants.au3>I see that in many scripts i look at but dont know what it means, does it run the script in combination with the one its included in? how do you know what to put there?? It means that AutoIT is an object oriented programing language. [quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD() Link to comment Share on other sites More sharing options...
Valik Posted February 9, 2006 Share Posted February 9, 2006 It means that AutoIT is an object oriented programing language.If you're trying to make a joke, it's not very nice to tell somebody who's new to scripting/programming false information like this since they will obviously not know any difference. If you're not making a joke, you're just plain wrong. AutoIt is not an object-oriented language and I have no idea what would ever give you the impression that it is. 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