AutoHotkey Community

It is currently May 27th, 2012, 1:01 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 

How do you make a task oriented script?
Document it first, then I know what it's to do
Whats a document?/Its all in my head
Small scraps and notes
A note book
A combination of the above
Other
You may select 1 option

View results
Author Message
 Post subject: Brain storming
PostPosted: September 7th, 2005, 5:58 am 
Offline

Joined: February 14th, 2005, 10:54 am
Posts: 447
Location: Texas, Usa
I was interest in how others made scripts, Like AGU and his task organizer...

Most of the time I use a notebook and jot down small reminders of this and that, rarely I write a document explaining how it will work(you know, for them big projects). Other times its all in my head.

_________________
my lame sig :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 7th, 2005, 7:35 am 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
It all starts in my head.
1) start to write the important part of the script (could be GUI or the action, depending which is more important/difficult).
2) re-structure the code and optimize it
3) comment the code, since I want my codes to be maintained (by myself or others).
4) Add the less important and the nice-to-have stuff
5) do 2) and 3) again

There is no document, only the source code with comments.
But I always try to
- separate code into GUI, Data and Action subroutines
- Use speaking names for vars, routines, functions
- indent the code
- not use GoTo
- not encapsulate subroutines into each other (instead use GoSub)
- not use more than one return per subroutine/function

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 7th, 2005, 8:01 am 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2545
Most of the time I would have to say "Whats a document?/Its all in my head" but if it's something that I'm trying to figure out a solution for and/or a larger than normal script then the documentation is usually in the form of comments and/or commented out bits of code throughout the script. These comments and sections rarely remain in the final code though.

In general, I'll start coding the obvious parts that are needed to create a basic structure to work with, then start adding code to support the objectives. When I get to a point where things seem to be stable but there's more to add and/or a new idea comes to mind, I'll create a copy of the file and start modifying the copy with new code. Once the objectives are met I run a few tests, save a copy again, strip all non-functional/unnecessary code, strip all comments and test again. If all goes well I'll go back through the code and add comments at various key points (although I have a bad habit of skipping this very important step when I don't have much time available :oops: ) .

The reason for stripping the comments then adding them again is to follow the flow/logic (or lack thereof :lol: ) to determine if anything may have been overlooked and/or might be accomplished better using different methods. Fortunately/unfortunately this can also lead to many changes and/or a rewrite.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 7th, 2005, 10:05 pm 
Offline

Joined: September 7th, 2004, 9:20 pm
Posts: 275
Location: France
I essentially program AHK for my work, for my own usage, as in my work there are a lot of usage of texts (of witch Word) and Excel sheets.
The aim of my work on AHK is to speed up and automate the use of my IBM Mainframe 3970 Windows emulation, and to take information elements (via clipboard) and give them a treatment under Word or Excel.

I note my ideas on a (paper) notebook when they come. As I use only one (compiled) file (the autohotkey.ini), I put them in it as soon as I can. I also note in there the projects, the "bugs" to resolve (things witch don't work or witch don't work as I want), the projects (short, median and long term), the to do list, the characteristics of the features to implement...
I code almost "directly", and if I have an important part to develop, I can make a separate ahk file for test purposes, before integration.

I take attention essentially to :
- Indent correctly the code,
- Comment it for simplify the future maintenance
- Save each modification with the date and a number, to be able to retrieve a working version if my trials are unsuccessfull.
- give names to variables, labels and so on wtich can't be confused ones with the others.
- try to use (as frequently as possible) a same (modified at launch time) GUI for differents purposes (but with similar characteristics).

In the future, I will have to develop separates (little) parts that must run independantly of the rest of the code.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2005, 10:30 am 
Offline

Joined: February 16th, 2005, 5:32 pm
Posts: 44
Well, some time ago I would have voted for "all in my head". But I've found that I tend to have so many running tasks (not only AHK) that some of them would be forgotten for a long time or even forever. :? And even if they were recovered somewhen I would start stratching my head: "What the heck did I DO here??"

So I decided to have a "task manager" for myself. Right now I use TreePad, a text/richtext editor that arranges your notes in a treelike structure.

When I do a bigger AHK thing I normally start drawing some outlines and collecting ideas. Next I try to break them up to smaller parts and to find basic functions/subs I need. It's then back and forth: writing down the structure in TreePad, writing some code, updating and enriching the TreePad file, writing more code, etc... I also keep track of important variables, especially where they are set and modified. And I try to have separate files, like one for the GUI and GUI actions, one for data processing and so on. Whenever possible I try to write scripts that can be reused, e.g. rather one that deals with queues/stacks in general and can be included into many other scripts than just one fragment deep inside a cryptic sub.

Oh, and I like paper notes, since they are quick, but once you start they usually tend to get lost in thousands of other notes lying around. So I try to cut this down to a minimum. (Gee, we have those ultra fast computers that can display a million colours and have huge hard disks to hold everything you could probably write down in your entire life and we still use pen and paper... something must have gone wrong in the development of computers.)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2005, 2:21 pm 
Offline

Joined: August 15th, 2005, 2:57 pm
Posts: 57
Freemind works well! Its free and allows you to drag your ideas around. You can then print an outline-like report.
http://freemind.sourceforge.net/


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2005, 5:25 pm 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2545
For misc. notes I use an app that I put together a while ago. Here's a link in case anyone finds it useful. It hasn't been updated in a while but will likely be updated soon to add a bit more functionality as I've been using it quite a bit lately.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 14th, 2005, 9:45 am 
Offline

Joined: February 16th, 2005, 5:32 pm
Posts: 44
Hm, I'll add a treepad link then too. :) You can buy a full featured rich text version, but there is also I nice free version (easily overlooked on the main page): http://www.treepad.com/treepadfreeware/


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 14th, 2005, 7:16 pm 
Offline

Joined: September 7th, 2004, 9:20 pm
Posts: 275
Location: France
I use Sniplets 2.1.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 15 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group