suthers Posted August 31, 2005 Posted August 31, 2005 Hi All! I'm writing my first script, and it's getting quite involved at 5 pages long with numerous loops. It's mentioned in one of the help files that you can view/edit the script in an editor that understands the syntax & colors the code accordingly. Where do i find such a one, and are there are freeware ones? Also, if I want to do a test at the start of the script and then branch into seperate program paths depending on the result, how do I do it without 'goto'? Do I write the seperate paths as seperate scripts & call them from the initial one? And if so, how do I do that? Shalom Bill
/dev/null Posted August 31, 2005 Posted August 31, 2005 (edited) editor that understands the syntax & colors the code accordingly. Where do i find such a one, and are there are freeware ones?http://www.autoitscript.com/autoit3/scite/Also, if I want to do a test at the start of the script and then branch into seperate program paths depending on the result, how do I do it without 'goto'? Do I write the seperate paths as seperate scripts & call them from the initial one? And if so, how do I do that?Use functions. See help file for more details....; Test your condition here if $condition = 1 then action1() elsif $condition = 2 then action2() else action3() endif func action1() ; Your code here endfuncCheersKurt Edited August 31, 2005 by /dev/null __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *
DoctorX Posted August 31, 2005 Posted August 31, 2005 Yeah, I grew up with BASIC so it took me a while to get out of the habit of relying on GOTO commands myself. Once you get used to working with functions though, you'll find it's so much easier to keep track of everything. The script I'm working on now has over 3,000 lines of code but the main program is actually only eight lines long. It just calls different functions, which in turn call different functions, etc. -DRX
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