stolie Posted October 21, 2004 Share Posted October 21, 2004 Hi all I have a script that i only want to repeat say 10 times How do i use the for/next, or loop function thanks in advance Link to comment Share on other sites More sharing options...
Guest BL@(K-R34P3R Posted October 21, 2004 Share Posted October 21, 2004 (edited) MyLoopFunc() Func MyLoopFunc() For $i = 1 to 10 (code here) Next (more code if needed) EndFunc Edited October 21, 2004 by BL@(K-R34P3R Link to comment Share on other sites More sharing options...
stolie Posted October 21, 2004 Author Share Posted October 21, 2004 Thankyou very much, much appreciated Link to comment Share on other sites More sharing options...
Guest BL@(K-R34P3R Posted October 21, 2004 Share Posted October 21, 2004 Anytime. Link to comment Share on other sites More sharing options...
the_lord_mephy Posted October 21, 2004 Share Posted October 21, 2004 Black and his functions *sigh* lol My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote] Link to comment Share on other sites More sharing options...
Guest BL@(K-R34P3R Posted October 21, 2004 Share Posted October 21, 2004 FuncTi0ns r00l d00d! Link to comment Share on other sites More sharing options...
t0ddie Posted October 22, 2004 Share Posted October 22, 2004 are'nt functions pretty much the same as routines and subroutines? like goto and gosub. i remember reading somewhere in here that they were evil, and it made spaghetti code. is it not a good idea to write a script, that is more "managed" and is completely divided into functions? thats what i used to do with autoit 2. now i just make comments in my code to keep track of whats what. are functions better added only when you want something done repeatedly in a script? would it be "bad programming" to write your entire script with functions? Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
scriptkitty Posted October 22, 2004 Share Posted October 22, 2004 (edited) You can write bad code without using functions, and you can write bad code with functions. Functions are just a tool, and they by themself do not make your script any better nor any worse. That said, funtions can make your script a lot better, and use far less lines. Functions are a great tool, and they make great for great code. It all comes down to GIGO. If we still have the article, you should read "Goto is evil." edit... AutoIt is basically does all its work with functions, and UDFs.... Edited October 22, 2004 by scriptkitty AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
Guest BL@(K-R34P3R Posted October 24, 2004 Share Posted October 24, 2004 You can write bad code without using functions, and you can write bad code with functions.Functions are just a tool, and they by themself do not make your script any better nor any worse.That said, funtions can make your script a lot better, and use far less lines.Functions are a great tool, and they make great for great code. It all comes down to GIGO.If we still have the article, you should read "Goto is evil." smile.gifedit... AutoIt is basically does all its work with functions, and UDFs....\FuNcTi0Ns r00l d00d! Link to comment Share on other sites More sharing options...
this-is-me Posted October 24, 2004 Share Posted October 24, 2004 Is there an echo in here? Who else would I be? Link to comment Share on other sites More sharing options...
the_lord_mephy Posted October 24, 2004 Share Posted October 24, 2004 I believe there is. @t0ddie: Functions don't make a script any better or worse like what scriptkitty said, but in BL@(K's script, the function is unneeded. My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote] Link to comment Share on other sites More sharing options...
Guest BL@(K-R34P3R Posted October 24, 2004 Share Posted October 24, 2004 I just like to have them. Partially because I like to have a name for a set of actions. I don't know why, but I have scripted in Dr Scheme, Java, Visual Basics, C++, AutoIt, and video game scripting and in all of them I luvvvv making functions. =/ Link to comment Share on other sites More sharing options...
Matt @ MPCS Posted October 24, 2004 Share Posted October 24, 2004 FYI Black, VB, C++, and Java are not "scripting" languages... you have never "scripted" in any of them. There is VBScript, Javascript, and several C variants in the form of scripting languages... but if you have used VB, C++ or Java then you have "coded" in those languages. There is a difference, just go google it. BTW how have you used so many languages yet you still have ABSOLUTLY NO clue when it comes to computers? Must be the product of public technology education. I hope you don't plan to bring your "scripting" skills to the real world. *** Matt @ MPCS Link to comment Share on other sites More sharing options...
Guest BL@(K-R34P3R Posted October 24, 2004 Share Posted October 24, 2004 I didn't mean that I have actually "coded" or "scripted" with all of them in a 1337 manner! I am n00b to more than one of them! I am just saying that I know how to read the code to get a general idea of what they are doing. So I suppose you can laugh now. Haha. =/ The ones that I have actually coded in is DrScheme, AutoIt, Java, a LITTLE VB, and various video game coding with their own language, (Morrowind). 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