jimmyjmmy Posted June 8, 2007 Share Posted June 8, 2007 Hi, Can someone here point to me the command for writing submodule. Example :- here are the various statements if statements Then do stuffs here if true Then perfom this submodule-A else do stuffs here ----------------- submodule-A ( doing all the stuff here and here etc.. ) Link to comment Share on other sites More sharing options...
ChrisL Posted June 8, 2007 Share Posted June 8, 2007 Is this what you mean? For $i = 1 to 2 If $i = 1 then Stuff1() Elseif $i = 2 then Stuff2() EndIf Next Func Stuff1() Msgbox(0,"Stuff1","$i = 1 so use stuff1 function") EndFunc Func Stuff2() Msgbox(0,"Stuff2","$i = 2 so use stuff2 function") EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
jimmyjmmy Posted June 9, 2007 Author Share Posted June 9, 2007 Yes, correct. Thanks. Is this what you mean? For $i = 1 to 2 If $i = 1 then Stuff1() Elseif $i = 2 then Stuff2() EndIf Next Func Stuff1() Msgbox(0,"Stuff1","$i = 1 so use stuff1 function") EndFunc Func Stuff2() Msgbox(0,"Stuff2","$i = 2 so use stuff2 function") EndFunc Link to comment Share on other sites More sharing options...
jimmyjmmy Posted June 9, 2007 Author Share Posted June 9, 2007 I have a question, should I declare the subroutine before or after Stuff1() Thanks Is this what you mean? For $i = 1 to 2 If $i = 1 then Stuff1() Elseif $i = 2 then Stuff2() EndIf Next Func Stuff1() Msgbox(0,"Stuff1","$i = 1 so use stuff1 function") EndFunc Func Stuff2() Msgbox(0,"Stuff2","$i = 2 so use stuff2 function") EndFunc Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 10, 2007 Share Posted June 10, 2007 I have a question, should I declare the subroutine before or after Stuff1()AutoIt uses the term "function" instead of subroutine. And AutoIt does not care where in the script a function is declared (before or after it is used). Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
jimmyjmmy Posted June 11, 2007 Author Share Posted June 11, 2007 AutoIt uses the term "function" instead of subroutine. And AutoIt does not care where in the script a function is declared (before or after it is used). ok, Thank You Very much PsaltyDS and members. 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