AutoHotkey Community

It is currently May 26th, 2012, 1:59 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 55 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
 Post subject:
PostPosted: March 13th, 2005, 4:19 pm 
Offline

Joined: September 24th, 2004, 3:00 pm
Posts: 814
Location: Germany
Hi Toralf,

it nearly works perfect. Maybe it would be useful to let automatically process a file if it is specified via command-line. So it's easy to intregrate a compiled version your favourite editor.

In very big scripts I like indented subroutines so that the section-browser of MED will ident them also. Maybe some others use this way to get more structure. What about (optional) preserving indention of Subroutines and Hotkeys?

Code:
Hotkey::
   if enable_functionA = yes
      gosub, main_functionA
Return

main_functionA:
   gosub, sub_fA_subroutine
Return

   sub_fA_subroutine:
      ; indented subroutine
   Return

nextHotkey::
   ; bla bla
Return


Tekl


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 14th, 2005, 12:24 am 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
Dear Tekl,

Thank you for the suggestions. But I do not think I will gonna do them.
1) To extend the script to accept command line parameters would take some effort, even so it is feasible. But I think only very few users would benefit. And the command line would have many parameters.

2) To preserve indentations is not the objective of the script. It was always ment to re-astablish a indentation that reflects the syntax. Especially if there is none or wrong indentation. How should the script know that some indentations are correct while others need to be modified?
If you want to do this for your scripts you could use the column edit function of UltraEdit. It is very useful in these cases.

Feel free to make a mod that fits you needs.

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 5th, 2005, 1:50 pm 
Offline

Joined: June 4th, 2005, 12:03 pm
Posts: 17
Location: Göttingen
Hello Toralf
great work! I use it for all my scripts, myself being very untidy in writing.
Added a few lines for function recognition, as I need them.

Edit by moderator: Toralf has applied these revisions to the first post of this topic.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 6th, 2005, 9:32 am 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
Hajos wrote:
Hello Toralf
great work! I use it for all my scripts, myself being very untidy in writing.
Added a few lines for function recognition, as I need them.


Thank you Hajos for the new feature and the spelling correction you did.
I didn't test, but have updated the script in the first post.
I like the line
Code:
FirstWordIsFunction := ( FunctionBracketPos > 0 )
This is beautiful, I wasn't aware that it's feasible.

I wonder if the case correction would work in all cases? I think the script has to check at least the second and third word as well. So, it captures all of the following lines
Code:
Add(x,y)
result=Add(1,2)
result= Add(1,2)
result =Add(1,2)
result = Add(1,2)
And maybe even each line of the script has to be searched for text infront of a "(" to find function names. Because function names may appear inside other commands.
Code:
MsgBox % "The answer is: " . Add(3, 2)
Do you think this is feasible? I fear that it will be very difficult to recognize.

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 6th, 2005, 9:43 am 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
And next thing that has to be checked is correct indentation for line continuation
Quote:
A line that starts with "and", "or", ||, &&, or a comma is automatically merged with the line directly above it.
Everyone is welcome to do it. [If I find time, I will do it.] Please post your findings or solutions. Thanks

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 8th, 2005, 11:00 pm 
Offline

Joined: June 4th, 2005, 12:03 pm
Posts: 17
Location: Göttingen
Hello Toralf,
thx for integrating my lines into your script - makes me proud.
And here´s my try at an extension concerning line continuation.
As to the other questions (case correction of function names), I´ve to think about it.
Code:
;  - added 2005-06-08: indentation of implicit continuation lines, by HJS (Hajos)
;      (i.e. lines that start with "and", "or", ||, &&, or a comma)

Greetings
Hajos

Edit by moderator: Long script removed because Toralf has applied these revisions to the first post of this topic.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 9th, 2005, 12:28 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
Hi Hajos,
Thank you for the improvements. I have included them into the first post and added choice for tabs/spaces.

Assuming your approval I have made you co-author of this script.

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 22nd, 2005, 9:33 am 
Offline

Joined: June 4th, 2005, 12:03 pm
Posts: 17
Location: Göttingen
Hi Toralf,
Quote:
Do you think this is feasible?
Couldn´t resist the challenge.
So here´s a further instalment
Modifications:
- Spell checking of self defined functions and subroutines (Upper/Lower case) uses names in function/subroutine definition
- The present indentation inside block comments and continuation blocks may be preserved
- a change in line 893 (fix of "else" indentation after a one line if command which is itself an if or loop command; works for my scripts)Hajos

Coment from moderator: For the latest version, see http://www.autohotkey.com/forum/viewtopic.php?t=7810


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 23rd, 2005, 8:45 am 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
Dear Hajos,

I got your email, thanks, but I've problems to keep up with the changes. It is difficult for me to compare your and my script to find differences and maintain this post.
I suggest you start a new post with your script in the first post. Then you can take over the maintainance and development. I will from time to time stop by and take a look.

Good luck, and thank you very much for the cooperation

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 16th, 2006, 1:26 am 
Offline

Joined: January 13th, 2006, 10:28 am
Posts: 36
Location: Brisbane, Australia
This is great!

I like to use lots of spaces in my scripts, it not only makes them seem longer but helps me to block certain parts. This complements that nicely and works on everything I have done.

_________________
The rapidity of particle flow alone determines power: LRH


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 55 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC [ DST ]


Who is online

Users browsing this forum: c0ntinuity, Yahoo [Bot] 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