xuzo Posted November 1, 2015 Posted November 1, 2015 I'm having a hard time knowing how to input the code, I always get it wrong and don't know where to start for example, how do I learn where to put ' or " or { or { ect....The first example works, with trial and error, but I wish I could learn how to do this right... MsgBox(0, "Saved Variables", $title & @CRLF & $city & @CRLF & $country)MsgBox(0, "Saved Variables", "$title & @CRLF & $city & @CRLF & $country")MsgBox(0, "Saved Variables", "$title" & @CRLF & "$city" & @CRLF & "$country")
water Posted November 1, 2015 Posted November 1, 2015 A good place to start learning AutoIt is the help file (esp. the first chapters) and the wiki where you will find some tutorials.In your case it is easy: You enclose a string in " or '. If you want to output the content of a variable do not use " or '. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
junkew Posted November 1, 2015 Posted November 1, 2015 (edited) Difficult to answer as you do not give any background on other languages you knowstart from scratch: https://scratch.mit.edu/projects/editor/?tip_bar=getStartedstart early: http://www.calormen.com/jslogo/start basic: http://www.calormen.com/jsbasic/Basic elements of any programming language (and once you now that it should not be hard to learn a new one), you can find details in AutoIT helpKeywords/reserved wordsif then else function variables and constantsIn AutoIT starts with $ (however I remember experimental that its not required)constants start with a @loopsfor whileblocks that start with { and end with }Conditionals like: if then else endif input and outputfunctions and subsAs in your example it depends on what you try to accomplishhttps://www.autoitscript.com/autoit3/docs/functions/MsgBox.htmso the 0 you give would have been better to give $MB_OKYou probably wanted$city="Amsterdam" $country="The Netherlands" MsgBox($MB_OK, "The title I wan to see on top of my messagebox", "A multiline text " & @CRLF & "showing the city: " & $city & @CRLF & " a country: " & $country & @CRLF)My advices is to write first like this and over time you combine it in functions, it makes your code clearer to understand (however in the end its just a coding style)$city="Amsterdam" $country="The Netherlands" $myText="" $myText=$myText & "A multilinetext" & @CRLF $myText=$myText & " Showing the city" & $city & @CRLF $myText=$myText & " Showing the country" & $country & @CRLF MsgBox($MB_OK, "The title I wan to see on top of my messagebox", $myText)And in the end if you want to understand any programming language build a compiler yourself with for example http://www.antlr.org/ Edited November 1, 2015 by junkew FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
mikell Posted November 1, 2015 Posted November 1, 2015 you can find details in AutoIT helpYou forgot thehelpfile FAQ, especially (in this case) the #5
junkew Posted November 1, 2015 Posted November 1, 2015 https://www.autoitscript.com/autoit3/docs/faq.htm#5 FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
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