adam51 Posted April 19, 2017 Share Posted April 19, 2017 hi, im fairly new to autoit, ive been watching youtube videos to learn, I have successfully been able to do some basic commands but 2 of the codes that I have tried to do have not worked. I have checked and checked again but there seems to be nothing different from my code to the persons on the youtube video and theirs is working fine for them, Global $message $name $ name = "adam" $ message = "hello" MsgBox(0,"title", "my name is, "$ name") this is one of the scripts, any ideas please? Link to comment Share on other sites More sharing options...
kylomas Posted April 19, 2017 Share Posted April 19, 2017 adam51, If you are not using SciTE ownload and install the FULL version. Run your script in SciTE and it will help you with these errors. kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Subz Posted April 19, 2017 Share Posted April 19, 2017 @adam51 Welcome to AutoIt forums, highly recommend looking at AutoIt help file as it has examples for almost every function, it will also show you the correct syntax/format for coding in Autoit. For example this is how your code should look, note: No spaces between $ and variable name Use & to join/concatenate two or more strings together Anyway I hope that helps get you started, happy coding. Global $sName = "adam" Global $sMessage = "hello" MsgBox(0,"title", $sMessage & " my name is, " & $sName) SkysLastChance 1 Link to comment Share on other sites More sharing options...
adam51 Posted April 20, 2017 Author Share Posted April 20, 2017 thanks guys. out of interest, why the "s" after "$" as in the help files on msgbox, I could not find it in there? Link to comment Share on other sites More sharing options...
adam51 Posted April 20, 2017 Author Share Posted April 20, 2017 this is where I got this coding from. so does his work because he has the full version? SkysLastChance 1 Link to comment Share on other sites More sharing options...
Subz Posted April 20, 2017 Share Posted April 20, 2017 Just good coding practice, $sVar implies variable is a String, $aVar would imply an Array etc... The following wiki link will help. https://www.autoitscript.com/wiki/Best_coding_practices Link to comment Share on other sites More sharing options...
adam51 Posted April 20, 2017 Author Share Posted April 20, 2017 I get it, thanks, I hope I will get better quickly Link to comment Share on other sites More sharing options...
Subz Posted April 20, 2017 Share Posted April 20, 2017 Regards the video, no his information is correct, you probably want to watch the video in fullscreen so you can actually see the code being written, this is his output from the video: Global $message, $name $name = "Wesley" $message = "Hello and welcome" MsgBox(0,"My title", "My name is " & $name) 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