AutoHotkey Community

It is currently May 27th, 2012, 6:37 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 741 posts ]  Go to page Previous  1 ... 8, 9, 10, 11, 12, 13, 14 ... 50  Next
Author Message
 Post subject:
PostPosted: April 11th, 2011, 12:21 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
v2.0-a003-9a480e6 is now available. The changes are:
  • #MustDeclare [On|Off] enables or disables must-declare mode. If used in a func lib file, it affects only that file and any files it explicitly #includes. However, it inherits its default setting from the main script. It is positional, but cannot be used inside a function (due to the following point). Functions default to either assume-local or must-declare depending on the setting at the point the function is defined, but this can be overridden by using Global, Local or Static without a variable name.
  • Local varname no longer activates assume-global mode.
  • Global varname no longer activates assume-local mode.
  • Global varname, if used outside of any function, makes varname visible to all functions below that point except where overshadowed by a local declaration or parameter.
  • Var varname declares a global variable with the same behaviour as an implicit global variable; i.e. varname is not visible in functions by default.
  • Removed obsolete multi-select option "4" from FileSelectFile.
  • Changed method of escaping quote marks in quoted strings to `" (escape char followed by quote mark).
  • Single and double quote marks may be used interchangeably (but the start and end of each string must match).
  • Quoted strings may contain variable derefs, such as "the %x is %y".
  • Changed A_OSVersion to return major.minor.build; e.g. Windows 7 SP1 is 6.1.7601.
  • Removed A_OSType since Win9x is not supported.
  • Renamed A_LoopFileFullPath to A_LoopFilePath and A_LoopFileLongPath to A_LoopFileFullPath.
  • Removed WinMove's special handling of the word "Default", which was equivalent to omitting the parameter.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2011, 1:37 pm 
Offline

Joined: September 15th, 2006, 10:25 am
Posts: 567
Lexikos wrote:
v2.0-a003-9a480e6 is now available. The changes are:


These changes look very good!

_________________
If i've seen further it is by standing on the shoulders of giants

my site | ~shajul | WYSIWYG BBCode Editor


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2011, 3:17 pm 
Offline

Joined: April 8th, 2009, 8:23 pm
Posts: 3036
Location: Rio de Janeiro - RJ - Brasil
Not sure if already discussed, but...
http://www.autohotkey.com/docs/commands/InputBox.htm
Will "Font" ever be implemented? (not that I'd need it badly, I'm just wondering)

_________________
"Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried.
"
Image
Antonio França
My stuff: Google Profile


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2011, 5:41 pm 
Lexikos wrote:
Removed obsolete multi-select option "4" from FileSelectFile.

...did I miss the discussion on this? Why is it obsolete? Is there any way to enable multi-select in FileSelectFile? What exactly was removed?...& why? Are the (full) docs for AHK_L online? I don't see a command list in the AHK_L Docs...which means I can't file FileSelectFile docs, without guessing the URL...FileSelectFile


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2011, 5:47 pm 
Offline
User avatar

Joined: May 5th, 2007, 7:24 pm
Posts: 1240
Location: Seville, Spain
@Guest:
Docu wrote:
M: Multi-select. Specify the letter M to allow the user to select more than one file via shift-click, control-click, or other means. M may optionally be followed by a number as described below (for example, both M and M1 are valid). To extract the individual files, see the example at the bottom of this page.

_________________
fincs
Highly recommended: AutoHotkey_L (see why) (all my code snippets require it)
Formal request to polyethene - I support the unity of the AutoHotkey community
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2011, 5:50 pm 
Yes, fincs, I understand the M multi-select option, but I'm wondering if that's exactly what he removed (& perhaps didn't update the Docs yet)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2011, 5:54 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
Anonymous wrote:
...did I miss the discussion on this?
Yes. Look for "Obsolete option" in the FileSelectFile help (any will do, it needn't be AHK_L).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2011, 5:54 pm 
Offline
User avatar

Joined: May 5th, 2007, 7:24 pm
Posts: 1240
Location: Seville, Spain
No. He specifically referred to the 4 option, which IIRC is an AutoIt2 backwards compatibility flag.

_________________
fincs
Highly recommended: AutoHotkey_L (see why) (all my code snippets require it)
Formal request to polyethene - I support the unity of the AutoHotkey community
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2011, 8:40 am 
Offline

Joined: March 10th, 2011, 7:17 pm
Posts: 374
Lexikos wrote:
Code:
WinMove, WinTitle, WinText, X, Y, DEFAULT, DEFAULT
Can anyone think of a good reason to keep this behaviour?


wat? no. remove 'DEFAULT' option


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2011, 9:45 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
guest3456, you're about 20 hours too slow. It's already been removed.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2011, 10:42 am 
Offline

Joined: December 28th, 2010, 11:59 am
Posts: 63
Location: France
Lexikos wrote:
dysmas wrote:
Sorry but for #Delimiter you are wrong. There are guys who use it, I am one of them. For Unichars (http://unichars.sourceforge.net) it is mandatory otherwise the character | cannot be used in codes. I replaced the delimiter by chr(1)
Reply from Lexikos :
I intended to reply to this sooner but it slipped my mind. It sounds like you've confused the #Delimiter directive with something else. #Delimiter changes the command arg delimiter from comma (,) to a character of your choosing, and has nothing to do with |. The only advantage to using it might be that you wouldn't need to escape commas in literal text.


Yes Lexikos, you are right, I made a mistake, what I was thinking of was Gui, +Delimiter

Thanks for your work, I am really interested.
I would also be very interersted to see the features of AutoHotkey_H which allow sharing variables with AutoHotkey.dll to be implemented. Perhaps it is already done, I didn't read the whole topic.
Details on this question are found here :
http://www.autohotkey.com/forum/viewtopic.php?t=43049&postdays=0&postorder=asc&start=409


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2011, 2:24 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
I was quite busy recently so I didn't follow the discussion up until today. I have read up to the page 6 and will comment now, so sorry if something is already discussed on subsequent pages which I will read later.

First of all, congratz for this great work. Amazing. Now AHK looks like real language, finally.
Bellow I will mention some things that I think deserve attention. Oterwise, I agree with Lexikos on everything else.
Lexikos wrote:
Legacy commands to consider keeping (for convenience): IfWinActive, IfWinExist, IfInString, IfExist. I personally don't find IfInString all that convenient. Should it be kept? Should the others be kept?
I would remove those. It's much more logical to use pure "if" form. The benefit is that you reduce the number of constructs available and number of documentation pages and unnecessary redudancy which all lead to confusion.
Lexikos wrote:
As a substitute for SetFormat (which has been removed), I've included a script function for formatting strings. Take a look in Lib\format.ahk for a description of the syntax. It is basically a mixture of .NET's String.Format function and the C runtime's format specifiers. Any comments or suggestions about the syntax are welcome. Once the syntax is finalized, I'll add a built-in function.
Why do we need this? Since replacement of ahk vars in the literal strings is already done, why not adding some formating chars to it: "My integer: %num%, my hex: %num:h%", or something similar. This is so 'every day' that it should be integrated this way.
Lexikos wrote:
I've wondered for a while why we have commands like WinSet and WinGet with numerous sub-commands, then separate commands like WinGetClass and WinSetTitle
I would personaly like to see it as an object. For instance if W represents window obtained by some mean, we could use w.tittle, w.pid etc... There are few aditional benefits of this approach, other then the convenince and reduced number of commands - you could choose evaluation type - i.e. in lazy mode don't get the tittle unless its used. You could call W.refresh() later if you want update, which is faster then repeating all the code again, or using functions; you keep it as organised whole as it is (some other automation languages used this approach); you can easily save entire info using json; also, you could specify which attributes of the window to get asap and which are the lazy ones, lets say WinExist("Notepad", class pid title children) will preload given attributes and lazy load other ones you may eventually need. WinExist("Notepad") could give only handle, WinExist("Notepad", *) could give everything. Just an idea, could be improved probably.
Lexikos wrote:
The idea is that expressions may be embedded in a non-expression arg by writing %func(params) or %(expression). I believe this will require extensive changes to implement properly, so it probably won't be implemented in v2.0. However, I will add support for the simplest case, %(var), if there's enough demand for it.
I would personaly like to see this in v2. I am talking about the complete idea.
Lexikos wrote:
Window groups could be improved to make exclusions more intuitive – e.g. GroupExclude G, title would combine with existing rules to exclude all windows with “title” in the title, whereas GroupAdd G,,,, title currently adds all windows to the group, except those with “title” in the title. Furthermore, supporting ahk_class, ahk_id, etc. in the exclusions could prove very useful.
If windows as objects are implemented, groups follow naturally as collection object:
Code:
  wndGroup := WindowGroup()
  wndGroup += WinExist("Notepad"); add all notepad windows to the group, WinExist returns window object
  wndGroup -= "ahk_class Notepad"    ;remove all notepad windows from the group
  wndGroup[i] ; i-th element of the group
  wndSubGroup := wndGroup["Notepad"] ;get all notepad windows from the group into new group
  wndGroup.toString("(%w.pid) %w.tittle , Childrens: %(w.children.count)") ;get the list of windows using given format string.

Quote:
Should SubStr(str, -1) extract the last two characters of str as it does now, or only the last character?
The last one only IMO.
Lexikos wrote:
If someone is keen to write a replacement for these, I'd consider removing them; but it doesn't seem worth much trouble.
I vote for removing completely. Garbadge, IMO.
Fincs wrote:
Auto-concat is one of my favourite features of AHK, so please don't remove it.
I totally agree. I you still wish to remove something, remove the dot :)
Leraning one wrote:
Too much versions and forks of AutoHotkey, different syntax, different rules = bad.
Transition is always initial suffering for the benefit of the improved life later on.
Lexikos wrote:
By the same token, the functionality of "in" and "contains" could be implemented as methods of the array object. There's no real need for additional syntax.
Perfect.
jaco0646 wrote:
Other random ideas:
#SingleInstance
Should this be the default?
SetTimer
Should this make scripts automatically #Persistent?
ListLines, Off
Should this be the default? Chris mentions that it increases performance.
GuiClose
Should ExitApp be the default? It's definitely the most common behavior for the GUIs I've written.
All good suggestions IMO.
IsNull wrote:
For AHK v2 I recommend to remove the Commands completly and replace them with Build-In Methods.
I agree. Further benefit is adoption of named parameters (InputBox example) as those are planned for function arguments.
Lexikos wrote:
At least two notable forum members have expressed a desire to remove literal assignment (var `= value) entirely. I like this idea. Do you?
I think it has its merrits.
IsNull wrote:
First off, keeping Commad-like Syntax is bound to also keeping the "traditional" Variable dereferecing %var%.
Totally agree. Also, perhaps making parenthesis "(...)" optional, like in VB or Ruby is good way to keep newbes happy and not to make some commands worse, like MsgBox which is used with only 1 param mostly. So, "msgbox( str ) = msgbox str" and "fun(a1, ... aN) = fun a1, ... aN".

My additions:

  • Change MsgBox name to Msg. It deserves this as it is used all the time. Also, it can be changed so that outputs messge in console for console scripts, so dropping "Box" is intuitive - msg displays message. You might really want to display GUI box in console window but that is not something people typically want.
  • More integrated object - Registry for instance, different collections (file, window etc...) This can maybe provide framework for replacing all different loop commands with only one that accepts object capable of iteration along with object that holds iteration options, ideally with neat syntax sugar.
  • Integrated lowlevel.ahk

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2011, 10:58 pm 
Offline
User avatar

Joined: November 2nd, 2008, 4:23 pm
Posts: 2906
Location: 127.0.0.1
Lexikos wrote:
AutoHotkey Basic uses several APIs which didn't exist in Windows 95, yet it (mostly) works there.

Source: http://www.autohotkey.com/forum/viewtop ... 966#433966
Is there a significant amount of unsupported checks and calls from operating systems that are no longer compatible with AutoHotkey? If so could they be removed to increase speed? Even if it would be slight, they serve no purpose.

_________________
aboutscriptappsscripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2011, 11:20 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
v2.0-a004-abad6fe is now available. The changes are:
  • Labels defined in functions are now private to the function which encloses them. If a global label with the same name exists, the local label takes precedence.
  • Changed IniRead default value to empty string; made it set ErrorLevel to indicate success/failure.
  • Removed FileReadLine, If[Not]InString, If[Not]Exist, IfWin[Not]Active, IfWin[Not]Exist and If Between. Added between() to stdlib.
  • Removed literal assignment (var `= value).
  • Changed StartingPos parameters of SubStr, RegExMatch and RegExReplace so that negative values are one-based positions counting from the right. Zero is not a valid value.
  • Split Loop into Loop, LoopFiles, LoopReg, LoopRead and LoopParse.
  • Changed File.ReadLine() to exclude the end of line character.

File.ReadLine: `r is still returned if the `n option was not passed to FileOpen. The other file-reading commands support `r, `n and `r`n by default. Perhaps FileOpen also should? If so, perhaps a single option "`r" should disable both translations (`r -> `n and `r`n -> `n), i.e. leaving any `r intact.

Frankie wrote:
Is there a significant amount of unsupported checks and calls from operating systems that are no longer compatible with AutoHotkey? If so could they be removed to increase speed?
There are several functions which are resolved via GetProcAddress, but only once at program startup. Some other sections are conditionally-compiled to exclude Win9x code. URLDownloadToFile resolves its five dependencies each time, but the time required is probably negligible compared to the actual download. The image-loading routines use GetProcAddress for five GDI+ functions, but this is necessary because Windows 2000 (which is at least partly supported) does not include GDI+ by default.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 13th, 2011, 12:46 am 
Offline

Joined: October 31st, 2010, 3:02 am
Posts: 87
Break and continue doesn't work in v2.0-a004-abad6fe!

the error msg is:
"Break/Continue must be enclosed by a Loop."

Code:
loop{
break
}

or

loop{
continue
}


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 741 posts ]  Go to page Previous  1 ... 8, 9, 10, 11, 12, 13, 14 ... 50  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo and 22 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