CWorks Posted August 24, 2006 Posted August 24, 2006 just wondering because i try and put as much as i can in it's own func I don't know if i'm just lazy or just don't like to think too much and just work on a function first and then add them one at a time to my program fixing as i go Koda make it so much easier
Xenobiologist Posted August 24, 2006 Posted August 24, 2006 just wondering because i try and put as much as i can in it's own funcI don't know if i'm just lazy or just don't like to think too muchand just work on a function first and then add them one at a time to my program fixing as i goKoda make it so much easierHi,is there a question? So long,Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
BPBNA Posted August 24, 2006 Posted August 24, 2006 I think hes asking if its good programming to use functions for the majority of your script. This is true to a point. You dont want to make EVERYTHING into a function, just the stuff that you use more than once. It makes it easier to debug when you can isolate a block of code(the function) to fix. If you want to bypass that part, you only have to comment out one line. Functions should be used in all scripts IMO.
PsaltyDS Posted August 24, 2006 Posted August 24, 2006 (edited) just wondering because i try and put as much as i can in it's own funcI don't know if i'm just lazy or just don't like to think too muchand just work on a function first and then add them one at a time to my program fixing as i goKoda make it so much easierFunctions are about reusing code. In a short, one time, script that just goes through a linear series of steps, they're not necesary. But anything you type more than once should be a function. Outside the single script, any function you use in multiple scripts, even if only once per script, should be put in a good general function that can be copy/pasted in where required. My install scripts have evolved over last few months, and functions (plus groups of functions in UDF files for #include) have made my scripts quicker to write and more reliable, as my standard functions are well understood and thoroughly debugged already (at least for me).P.S. I'm not a professional programmer, but I did sleep on a bench at Holiday Inn Express last night... Edited August 24, 2006 by PsaltyDS 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
BPBNA Posted August 24, 2006 Posted August 24, 2006 P.S. I'm not a professional programmer, but I did sleep on a bench at Holiday Inn Express last night... Hah! Nice.
CWorks Posted August 24, 2006 Author Posted August 24, 2006 well at least i know now i'm doing it right then after browsing the pages here i've seen enough udf's to last a lifetime so i guess all the functions kinda stuck with me I also find some things run a lot smoother by putting stuff in a function at least it's a lot easier for me to follow if everything is in it's place and just put some msg boxes where i think there may be a problem so i can catch the values now i just need to figure out how to do arrays and i am so sic of those damn stupid comercials
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