PeteF Posted November 30, 2016 Share Posted November 30, 2016 Hi all, I'm new at AutoIT (wrote a few small scripts so far), and experienced with VB6 and VBA for about 20 years. I have read the Welcome Wiki, the FAQ & the Best Coding Practices at the links below as well as viewed a few hours of beginner AutoIT tutorials on youtube. Welcome to the AutoIt Wiki.. https://www.autoitscript.com/wiki/ FAQ.. https://www.autoitscript.com/wiki/FAQ#In_SciTE Best Coding Practices.. https://www.autoitscript.com/wiki/Best_coding_practices ---- My first questions relate to proper coding and standard coding practices that I have not found in any of the above resources. 1.) I have noticed in other people's code, that sometimes a function name is prefixed with "_" (see example below) and other times they are not. What does the "_" signify? What does it mean to NOT use the "_" ? Func _ChangeTime($iHour, $iMin) Local $sTime = $iHour & RegRead("HKEY_CURRENT_USER\Control Panel\International", "sTime") & $iMin RunWait(@ComSpec & " /c Time " & $sTime, "", @SW_HIDE) Return $sTime EndFunc ;==>_ChangeTime 2.) In the example above, I understand the importance of.. ;==>_ChangeTime, but I have not been able to find any info on that coding practice. Is it something done voluntarily by the programmer or is it somehow built into SciTE to automatically add that standard notation? Also are there other similar standard notations used for IF/THEN's or While/Wend's, For/Next's that I should be using? 3.) Taking into consideration my 20 years experience with VB6 and VBA programming as an intermediate skill level programmer, what book on AutoIT programming would suit me best? --pete Link to comment Share on other sites More sharing options...
SadBunny Posted November 30, 2016 Share Posted November 30, 2016 @1) This is a convention and used to show that a function is a non-built-in function. (It doesn't have any functional effect.) @2) It's the result of the "Tidy AutoIt Source" application, reachable by Ctrl+T (or Tools > Tidy AutoIt Source or tidy.exe in the install dir) in the full version of SciTE for AutoIt. It suffixes functions by that comment, among many many other functionalities. Nothing to suggest for 3. But it's a very accessible language and this forum is very lively. I would say start out reading through the example scripts and the UDF's and just play around a bit. Maybe others can suggest actual study material. Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted November 30, 2016 Moderators Share Posted November 30, 2016 As far as #3, no you won't find a book worth purchasing. There have been a few published, but they almost immediately become outdated as the language is evolving all the time. Your best resource is right here on the forum; there is very little you could want to do with AutoIt that someone has not already attempted, and you have the real time advice and knowledge of users, devs and even the owner from time to time. coffeeturtle 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
PeteF Posted December 1, 2016 Author Share Posted December 1, 2016 13 hours ago, SadBunny said: Quote @1) This is a convention and used to show that a function is a non-built-in function. (It doesn't have any functional effect.) @2) It's the result of the "Tidy AutoIt Source" application, reachable by Ctrl+T (or Tools > Tidy AutoIt Source or tidy.exe in the install dir) in the full version of SciTE for AutoIt. It suffixes functions by that comment, among many many other functionalities. Ok, thank you, "convention" , that's the word I was looking for. Thanks for the answers, I'll put them to good use. FYI: As a newbie to AutoIT, I'm documenting all my questions & answers as they arise and creating a kind of Quick Start Reference Guide for AutoIT for the VB6 programmer. It should be a very useful document when I'm done and something I'll share with the community. -pete coffeeturtle 1 Link to comment Share on other sites More sharing options...
PeteF Posted December 1, 2016 Author Share Posted December 1, 2016 12 hours ago, JLogan3o13 said: As far as #3, no you won't find a book worth purchasing. There have been a few published, but they almost immediately become outdated as the language is evolving all the time. Yeah, from reading the reviews of AutoIT books on amazon.com I was getting the feeling that there weren't too many really good books on the subject. As I mentioned in a previous post, I'm writing an AutoIT/SciTE quick start & reference guide for my own use from the perspective of an experienced VB6 programmer totally new to AutoIT and SciTE. Does anyone here know roughly what percentage of members here on the forum fall into the category of experienced in VB6 or other similar language and relatively new to AutoIT? -pete Link to comment Share on other sites More sharing options...
kaisies Posted December 1, 2016 Share Posted December 1, 2016 (edited) I dev'd in VB6 for a few years, writing a few major applications w/database/file access. Autoit was an easy pickup for me (I had dabbled in it for years) and it continues to be easy to learn/understand most code. A TON of code is available online if you do enough digging. A lot of my VB6 code was hobbled together with excel sheets, so its fantastic to see that code is available in autoit and its very well supported (although I don't use Autoit to write to excel, I've moved to other things) If you knew how to code VB6 well, I doubt you'll struggle with Autoit. WMI queries, objects and ptr's are certainly more advanced, but very doable in autoit as well. Edit: Personally I've always used Functions prefixed with a _ to be functions that return something, and no _ is a function that does not return. Just what I do. Edited December 1, 2016 by kaisies PeteF 1 Link to comment Share on other sites More sharing options...
232showtime Posted December 1, 2016 Share Posted December 1, 2016 18 hours ago, PeteF said: 3.) Taking into consideration my 20 years experience with VB6 and VBA programming as an intermediate skill level programmer, what book on AutoIT programming would suit me best? --pete Help File is the best book I used for autoit... dmob and coffeeturtle 2 ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon. Link to comment Share on other sites More sharing options...
TheDcoder Posted December 1, 2016 Share Posted December 1, 2016 As you are new, the correct capitalization of AutoIT is AutoIt PeteF 1 EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
PeteF Posted December 1, 2016 Author Share Posted December 1, 2016 (edited) 4 hours ago, 232showtime said: Help File is the best book I used for autoit... I am self taught in many areas and my typical approach is to obtain 2 to 3 books by different authors, read one book for the basics and dig in actually doing what I'm trying to learn. Then when I hit a snag, I'll go to book 1 for the answer. If the answer is not quite clear, I go to book 2 and/or book 3 and the answer usually comes quickly because different authors explain things in slightly different ways which helps greatly to fill in any missing information. The AutoIt Help file is acceptable, but so far, it often leaves me with more questions that could probably be filled in with a well written book. With a physical book, I can highlight things, place sticky notes, and browse through them in a manner that the electronic versions cannot. I'd say, the electronic versions of HELP have more advantages over a physical book, but having both is the ideal situation. -pete Edited December 1, 2016 by PeteF Link to comment Share on other sites More sharing options...
PeteF Posted December 1, 2016 Author Share Posted December 1, 2016 6 hours ago, kaisies said: If you knew how to code VB6 well, I doubt you'll struggle with Autoit. WMI queries, objects and ptr's are certainly more advanced, but very doable in autoit as well. Yeah, so far my biggest frustration is the absence of seamless debugging features I had in VB6. I miss the "immediate window" and it's ability to query variables or issue commands as the program is running. I have installed dbug.au3, but it's a bit awkward compared to the VB6 IDE debugging features. It's just going to take some practice and getting used to. Info on Debugging is the one area I found greatly lacking among all the AutoIt and SciTE help resources. I searched the HELP file in SciTE on debug and found nothing useful at all. Spent hours searching and viewing youtube videos and only found one video on using dBug.au3 . That's why I was hoping for 1 good thorough book that covered all the bases for an AutoIt newbie. I'll figure it out, it's just going to take more time than I originally planned for, especially since I'm taking the time to document all the questions & answers as I encounter them. I've got about 7 pages so far of my own custom AutoIt Quick start & Reference guide. Thanks to you and EVERYONE for the help & encouragement to date. -pete coffeeturtle 1 Link to comment Share on other sites More sharing options...
PeteF Posted December 1, 2016 Author Share Posted December 1, 2016 4 hours ago, TheDcoder said: As you are new, the correct capitalization of AutoIT is AutoIt Thanks for the clarification. In listening to AutoIt videos I hear people pronounce it differently. What is the most widely used pronunciation of AutoIt? -pete Link to comment Share on other sites More sharing options...
TheDcoder Posted December 1, 2016 Share Posted December 1, 2016 Just now, PeteF said: What is the most widely used pronunciation of AutoIt? According to the creator of AutoIt, @Jon, its "Aww-Toe-It" EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
PeteF Posted December 1, 2016 Author Share Posted December 1, 2016 1 minute ago, TheDcoder said: According to the creator of AutoIt, @Jon, its "Aww-Toe-It" Is that "it", as in.. It is a nice day (1) or is it... "IT" as in.. I work in the IT department. (2) 1 or 2? coffeeturtle 1 Link to comment Share on other sites More sharing options...
TheDcoder Posted December 1, 2016 Share Posted December 1, 2016 1 EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
PeteF Posted December 1, 2016 Author Share Posted December 1, 2016 2 minutes ago, TheDcoder said: 1 Thanks, I'm adding the correct capitalization (AutoIt) and pronunciation (auto-it, [as in, It is a nice day]) to my AutoIt Quick Start Guide. Link to comment Share on other sites More sharing options...
TheDcoder Posted December 1, 2016 Share Posted December 1, 2016 Are you planning to make your guide publically available or is it just a quick reference for yourself? coffeeturtle 1 EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
PeteF Posted December 1, 2016 Author Share Posted December 1, 2016 2 minutes ago, TheDcoder said: Are you planning to make your guide publically available or is it just a quick reference for yourself? I'd like to submit it to the AutoIt community leaders for review and change it as needed and then release it to the forum for all to share. Link to comment Share on other sites More sharing options...
TheDcoder Posted December 1, 2016 Share Posted December 1, 2016 I will be looking forward to it PeteF 1 EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
LarsJ Posted December 1, 2016 Share Posted December 1, 2016 PeteF, You can try to look at this. I have not read it myself, but it's quite popular. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 1, 2016 Moderators Share Posted December 1, 2016 2 hours ago, PeteF said: I'd like to submit it to the AutoIt community leaders for review and change it as needed and then release it to the forum for all to share. Just realize that the Wiki really serves as our "Quick Start Guide" because it is continually updated. I would suggest (if you have not already done so) familiarizing yourself with the Wiki to see what subjects you plan to cover that aren't covered there. There is also the Welcome to AutoIt 1-2-3 (currently undergoing retooling) that serves as a training tool for people new to AutoIt. No intention to discourage your work, of course, just an awareness of what the forum standards are for new users wanting to learn the language. coffeeturtle 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this 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