Guest win286 Posted December 27, 2004 Share Posted December 27, 2004 I'm in the process of learning version 3 and need advice (& explanation) on how to structure scripts so they're maintainable. I found with version 2.x I'd get into trouble with scripts as they grow. I looked at several example scripts but still need guidance. TIA, DMS Link to comment Share on other sites More sharing options...
this-is-me Posted December 27, 2004 Share Posted December 27, 2004 I would recommend breaking all the major functions that can be individualised into include scripts. Then you can include them in the main programs without worry of breaking much if you change the include files. The main script will not have to worry with the implementation of the code, just the calling of it. Who else would I be? Link to comment Share on other sites More sharing options...
Andre Posted December 27, 2004 Share Posted December 27, 2004 Hi, The first i learned at school in programming class. DOCUMENT EVERYTHING !!!!!! Regards, Andre What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel! Link to comment Share on other sites More sharing options...
Nova Posted December 27, 2004 Share Posted December 27, 2004 (edited) Download scite by JdeB (Its an amazing simple to use text editor written for autoit)http://www.autoitscript.com/forum/index.ph...wtopic=5846&hl=Everything is colour coded, really easy to understand and to keep maintainable.Edit:A few pointers, the way I keep things maintained.-Keep all includes at the top of script-Keep all opts just under includes-Keep all varibles together, just under opts.-When writing functions I keep them all together and space in 2 or 3 times like thisFunc One() Line 1 Line 2 Line 3 EndFunc Func Two() Line 1 Line 2 Line 3 EndFunc-When writing If,Else,Endif statements, do so with tab spacings like soIf whatever = whatever Then MsgBox(4096,"", "True") Else MsgBox(4096,"", "False") EndIfHope that helps Nova Edited December 27, 2004 by Nova Link to comment Share on other sites More sharing options...
Doxie Posted December 27, 2004 Share Posted December 27, 2004 The things i belive is most important is to describe what it does. So i use ; very often in my script, that way i can track things easy. As Andre said, documentation is the key Were ever i lay my script is my home... Link to comment Share on other sites More sharing options...
tresa Posted October 17, 2006 Share Posted October 17, 2006 (edited) The things i belive is most important is to describe what it does. So i use ; very often in my script, that way i can track things easy. As Andre said, documentation is the key documentation will be more effective if it's the code that gives itself the information Except when perfomance is the issue it's best to do functions than documentation for instance : lines of codes with documentation expandcollapse popup.... ;find for something in the test array for $i=0 to ubound($test)-1 if $test[$i]=$toFind then exit loop next ;if found if $i<ubound($test) then msgbox(0,"","found") else msgbox(0,"","not found") endif ... oÝ÷ ÚƦyÊy«¡Úºg§µçZºÚ"µÍ[È[Ý^J ÌÍÝ[ÕÑ[ BÜ ÌÍÚOLÈXÝ[ ÌÍÝÝ KLBY ÌÍÝÝÉÌÍÚWOIÌÍÝ[ÕÑ[[]YB^][ÙB[[ÂY[Ý^J ÌÍÕÑ[ OUYH[ÙØÞ ][ÝÉ][ÝË ][ÝÙÝ[ ][ÝÊB[ÙBÙØÞ ][ÝÉ][ÝË ][ÝÛÝÝ[ ][ÝÊB[YoÝ÷ Ùû«¶¦¢·¢*.Á©í¶æ¦¢·«zënWºw-â·ly«2jëh×6 func InArray($thingToFind,$Array) for $i=0 to ubound($Array)-1 if $Array[$i]=$toFind then return true next return false endfunc func InTestArray($infoToFind) return InArray($infoToFind,$Test) endfunc .... if InTestArray($thingToFind)=true then msgbox(0,"","found") else msgbox(0,"","not found") endif ...... Edited October 17, 2006 by tresa Link to comment Share on other sites More sharing options...
PaulIA Posted October 17, 2006 Share Posted October 17, 2006 Talk about resurrecting an old post. That's got to be some kind or record. Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
Valuater Posted October 17, 2006 Share Posted October 17, 2006 "Welcome to Autoit 1-2-3" is very educational and has a great example for what you are askingin my signature below8) Link to comment Share on other sites More sharing options...
Valuater Posted October 17, 2006 Share Posted October 17, 2006 Talk about resurrecting an old post. That's got to be some kind or record. geeze... you're right!!!8) 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