Shayne Posted October 1, 2006 Share Posted October 1, 2006 Hi, In the past I have subdivided code in my script. That is, I have had my entire code divided into 'titled' sections so that I could simply 'call' a particular section if conditions are met. My problem now is that I've not written much for a while and I can't remember the special character or method required when you 'title' a section of code. I am not talking about commenting which uses the semicolon. Thanks in advance. Link to comment Share on other sites More sharing options...
lod3n Posted October 1, 2006 Share Posted October 1, 2006 Are you talking about functions?part1() part2() func part1() msgbox(0,"","This is part1") endfunc func part2() msgbox(0,"","This is part2") endfunc [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
Shayne Posted October 2, 2006 Author Share Posted October 2, 2006 No I'm not talking about functions, although I have achieved what I needed to do using the function syntax. I'm still curious though of what the syntax was for my original question. I think the 'sub sections' of code are identified with Labels? You would then call the corresponding Label in your code to jump to different sections. Thanks for your help. Link to comment Share on other sites More sharing options...
FuryCell Posted October 2, 2006 Share Posted October 2, 2006 Maybe #Include is what you are looking for? HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
lod3n Posted October 2, 2006 Share Posted October 2, 2006 (edited) Hmm, perhaps you are thinking of DOS batch script labelsif %var% = 1 goto sub1 if %var% = 2 goto sub2 :sub1 echo Var was equal to 1 goto end :sub2 echo Var was equal to 2 goto end :end echo this is the endbut there is nothing like that in AutoIt. It's a crappy way to do things in any case. You're much better off with functions and loops. Edited October 2, 2006 by lod3n [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
Shayne Posted October 2, 2006 Author Share Posted October 2, 2006 Hmm, perhaps you are thinking of DOS batch script labelsif %var% = 1 goto sub1 if %var% = 2 goto sub2 :sub1 echo Var was equal to 1 goto end :sub2 echo Var was equal to 2 goto end :end echo this is the endbut there is nothing like that in AutoIt. It's a crappy way to do things in any case. You're much better off with functions and loops. @ lod3n: Yes, I think you may be right. That was what I was thinking of. I have used a couple of functions anyway and they do seem to be quite simple to set up. Thanks for your help. 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