AutoHotkey Community

It is currently May 27th, 2012, 4:21 am

All times are UTC [ DST ]




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 1036 posts ]  Go to page Previous  1 ... 25, 26, 27, 28, 29, 30, 31 ... 70  Next
Author Message
 Post subject:
PostPosted: February 17th, 2010, 11:16 am 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Thanks majkinetor, I understand now, sorry for any confusion.

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 20th, 2010, 8:14 am 
Offline

Joined: November 30th, 2008, 1:51 pm
Posts: 73
Is there any plan to support variable length arguments for functions? I saw some scripts like [AHK_L] Arrays recently. I think it might work better if it can access variable length arguments?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 20th, 2010, 10:04 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Altho it would be nice to have, I wouldn't give it priority because you can pass variable number of arguments by passing an object. Only syntax differes.


Code:
fun(a1, a2, ... an)
fun(Object(1, a1, 2, a2, ... n, an))

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 20th, 2010, 11:27 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
jackieku wrote:
Is there any plan to support variable length arguments for functions?
Yes. (However, it's a long way away.) The current plan is something like:
Code:
; Accept two or more params - collapse additional params into an object and assign to params var.
MyFunc(x, y, params*) {
    ; ...
    ; Expand contents of params obj into the parameter list:
    OtherFunc(y, params*, x)
}
For example:
Code:
arr.insert(1, a, b, c)
; ...
Array_Insert(arr, index, items*){
   Loop % items._MaxIndex()
      arr._Insert(index++, items[A_Index])
   Return arr
}
I also plan to change _Insert to accept a list of items to add (after the initial numeric index), so combined with this it could look like:
Code:
arr._Insert(index, items*)  ; where 'items' is an object containing items to insert

I've been considering whether named parameters need to be factored into the design. For instance, MyFunc(Object(1,a,2,b,"name","foo")*) could potentially be equivalent to either MyFunc(a, b) or MyFunc(a, b, name: "foo"). From a user's perspective they might seem very similar, but they might require very different implementations.

majkinetor wrote:
I wouldn't give it priority because you can pass variable number of arguments by passing an object.
That isn't always feasible. I think that __get/__set/__call have much lower potential without the capability to accept an array of parameters. One example would be dll.func(...) where dll.func contains the address of a function and the types of its parameters.
Quote:
fun(Object(1, a1, 2, a2, ... n, an))
That is simply not practical. I plan to implement syntax sugar as below:
Code:
obj := [first, second, literal_key: value]
obj := Object(1, first, 2, second, "literal_key", value)
If * was supported, merging two arrays might be as simple as this:
Code:
z := [x*, y*]
I considered implementing [] syntax before named parameters, but again it might have a different set of requirements for implementation. I also considered implementing this and not named parameters, but I think allowing them in [ ] but not ( ) or requiring ([ ]) would be too inconsistent.

Another point is that if accepting parameters via an object causes a new object to be created (to store the parameters), the following three could be equivalent:
Code:
a := Object(1, x, 2, y, "n", z)
b := [x, y, n: z]
c := #(x, y, n: z)

#(items*) {
    return items
}



All code in this post is pseudo-code and might never work.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 20th, 2010, 11:56 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Quote:
That is simply not practical

Ofc. I am not against proposal, contrary. I just said that it can be done (in non-practical way) while there are things that can't be done at all (for instance iterators). Things that give new functionality, should IMO have greater priority.

Quote:
I've been considering whether named parameters need to be factored into the design

With this in mind I would actually give it top priority :lol:


BTW, since you actually re-implementing Lua, you should maybe check how each wish for AHKL is implemented there (for instance all u said above can be done in Lua).

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 21st, 2010, 3:57 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
I've updated the documentation to properly integrate AutoHotkeyU features. I've also included more detailed information about using DllCall etc. in Unicode vs ANSI builds, and other compatibility issues between AutoHotkey_L and mainstream AutoHotkey.

Online Documentation
Script Compatibility

majkinetor wrote:
BTW, since you actually re-implementing Lua, you should maybe check how each wish for AHKL is implemented there (for instance all u said above can be done in Lua).
I thought named parameters weren't actually supported, just simulated by passing a single table parameter? ;)
Quote:
Things that give new functionality, should IMO have greater priority.
I see your point, and in fact, I had no intention of starting to code those syntax features just yet. Enumeration of an object's contents is up high on my list (the accompanying syntax sugar isn't).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 21st, 2010, 10:17 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
Quote:
Revision 48 - February 21, 2010
  • Fixed: Standalone obj.() was not recognized as a valid expression.
  • ControlSend now uses WM_CHAR to support characters which have no associated keycode. For instance, this applies to "…" (en-US), "∞" in a Unicode build and {U+221e} in either build.
  • KeyHistory now shows the full 16-bit character code (and the character itself in Unicode builds) for VK_PACKET (VK=E7) events. Send may indirectly cause these to be generated for Unicode characters (via SendInput()).
Source: AutoHotkey_L


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 21st, 2010, 11:20 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Quote:
I've updated the documentation to properly integrate AutoHotkeyU features.

New documentation is much better. Thx.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 22nd, 2010, 9:00 pm 
Offline
User avatar

Joined: May 5th, 2007, 7:24 pm
Posts: 1240
Location: Seville, Spain
Minor typo:
Unicode documentation wrote:
As of revision 42, AutoHotkey_L includes Unicode support via separate ANSI and Unicode builds. Scripts written for ANSI builds (or mainstream AutoHotkey) face a number of compatibility issues with Uniciode builds.

_________________
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: February 23rd, 2010, 1:26 pm 
The following code causes AutoHotkey_L revision 48 to crash, where revision 47 was fine:
Code:
$^!+.:: Send, {U+2026}  ; …

I'm guessing this has to do with:
Lexikos wrote:
ControlSend now uses WM_CHAR to support characters which have no associated keycode. For instance, this applies to "…" (en-US), "∞" in a Unicode build and {U+221e} in either build.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 24th, 2010, 7:58 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
I wasn't able to reproduce the crash, but I assume it has something to do with the added VK_PACKET support. Scancode values are ordinarily limited to the range 0-0xFF (combined with the "extended" flag 0x100), but since SendInput()/VK_PACKET sets the "scancode" to a UTF-16 character code, I had changed it to conditionally avoid truncating the second byte. Unfortunately this caused out of bounds array access in another section of the keyboard hook code. I've corrected it, so try downloading again and let me know the result.

I also realised some sections might misinterpret the character code of VK_PACKET as an actual scancode, so VK_PACKET events are now ignored (other than placing them in KeyHistory).


Report this post
Top
 Profile  
Reply with quote  
PostPosted: February 24th, 2010, 10:07 am 
Lexikos wrote:
I wasn't able to reproduce the crash
Perhaps it depends on the (rest of the) content of the script file?
WinXP Pro SP3, running AHK_L Unicode build, using UTF-8 encoded script file in same directory as AutoHotkey.exe =>
- On first machine, running from a network-mapped drive => crash, no output.
- On second machine (different script contents, though mostly the same hotkeys), running from a local drive => crash, but after the Send character output.

Lexikos wrote:
try downloading again and let me know the result
Now all my hotkeys work, thank you.


Report this post
Top
  
Reply with quote  
 Post subject: Previous versions
PostPosted: February 28th, 2010, 9:12 pm 
Offline

Joined: January 29th, 2009, 9:50 pm
Posts: 483
Location: Belgium
can we download a previous version?

I have updated and overwritten the exe
now my player doesn't play music
i tried unicode and ansi
gues its the dllcall, and im not gonna rewrite te bass.ahk becouse dllcalls are like atoms to me, to complicated.


thx

_________________
Stopwatch emdkplayer
the code i post falls under the: WTFYW-WTFPL license


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 1st, 2010, 9:09 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
Source code is available for almost all revisions, but not binaries (the exe file). It won't work with the Unicode build as-is, but should work with the ANSI build if it works in standard AHK (with a few unlikely exceptions). If it doesn't work I suggest you start a new thread in Ask for Help. Include your script and results in standard AHK and ANSI AHKL. If you have already done so or when you do, post a link here and I'll look into it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 1st, 2010, 10:57 am 
Offline

Joined: January 29th, 2009, 9:50 pm
Posts: 483
Location: Belgium
Quote:
if it works in standard AHK

It never worked in standard AHK becouse i use
Code:
 Menu,x,Icon

Quote:
Include your script and results in ... AHKL

:D that is not likely its more than 3000 lines without the includes from the bass library.

I don't get errors so i cant see where the error is.
And im still cleaning up my code before i post it.
Problem is i do a lot of registry entrys that mess up the system.
So if someone tried it it may render the system usless, or even BSOD when at exit i delete the keys and they are not proper restored :twisted:



Quote:
Source code is available for almost all revisions

I dont have these capabilyties. :oops:

but don't bother ill search for the error somme more.
Or write a test script and post it.

thx

edit
found the right binary:
AutoHotkey_LRev32-1.0.48.4
works again :lol:

_________________
Stopwatch emdkplayer
the code i post falls under the: WTFYW-WTFPL license


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 1036 posts ]  Go to page Previous  1 ... 25, 26, 27, 28, 29, 30, 31 ... 70  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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