AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

AutoHotkey_L: Arrays, Debugger, x64, COM, #If expression ...
Goto page Previous  1, 2, 3 ... 27, 28, 29 ... 68, 69, 70  Next
 
This topic is locked: you cannot edit posts or make replies.    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
HotKeyIt



Joined: 18 Jun 2008
Posts: 4653
Location: AHK Forum

PostPosted: Wed Feb 17, 2010 10:16 am    Post subject: Reply with quote

Thanks majkinetor, I understand now, sorry for any confusion.
_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
jackieku



Joined: 30 Nov 2008
Posts: 73

PostPosted: Sat Feb 20, 2010 7:14 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
majkinetor



Joined: 24 May 2006
Posts: 4511
Location: Belgrade

PostPosted: Sat Feb 20, 2010 9:04 am    Post subject: Reply with quote

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))

_________________
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 7299
Location: Australia

PostPosted: Sat Feb 20, 2010 10:27 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
majkinetor



Joined: 24 May 2006
Posts: 4511
Location: Belgrade

PostPosted: Sat Feb 20, 2010 10:56 am    Post subject: Reply with quote

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 Laughing


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).
_________________
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 7299
Location: Australia

PostPosted: Sun Feb 21, 2010 2:57 am    Post subject: Reply with quote

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? Wink
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).
Back to top
View user's profile Send private message Visit poster's website
Lexikos



Joined: 17 Oct 2006
Posts: 7299
Location: Australia

PostPosted: Sun Feb 21, 2010 9:17 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
majkinetor



Joined: 24 May 2006
Posts: 4511
Location: Belgrade

PostPosted: Sun Feb 21, 2010 10:20 am    Post subject: Reply with quote

Quote:
I've updated the documentation to properly integrate AutoHotkeyU features.

New documentation is much better. Thx.
_________________
Back to top
View user's profile Send private message
fincs



Joined: 05 May 2007
Posts: 1163
Location: Seville, Spain

PostPosted: Mon Feb 22, 2010 8:00 pm    Post subject: Reply with quote

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
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]
Back to top
View user's profile Send private message
Guest






PostPosted: Tue Feb 23, 2010 12:26 pm    Post subject: Reply with quote

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.
Back to top
Lexikos



Joined: 17 Oct 2006
Posts: 7299
Location: Australia

PostPosted: Wed Feb 24, 2010 6:58 am    Post subject: Reply with quote

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).
Back to top
View user's profile Send private message Visit poster's website
ND
Guest





PostPosted: Wed Feb 24, 2010 9:07 am    Post subject: Re: AHK_L r48: Send {U+2026} Reply with quote

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.
Back to top
emmanuel d



Joined: 29 Jan 2009
Posts: 436
Location: Belgium

PostPosted: Sun Feb 28, 2010 8:12 pm    Post subject: Previous versions Reply with quote

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
http://www.autohotkey.com/forum/viewtopic.php?p=306819

the code i post falls under the:
WTFYW license
, wich meens its free to use
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 7299
Location: Australia

PostPosted: Mon Mar 01, 2010 8:09 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
emmanuel d



Joined: 29 Jan 2009
Posts: 436
Location: Belgium

PostPosted: Mon Mar 01, 2010 9:57 am    Post subject: Reply with quote

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

Very Happy 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 Evil



Quote:
Source code is available for almost all revisions

I dont have these capabilyties. Embarassed

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 Laughing
_________________
Stopwatch
emdkplayer
http://www.autohotkey.com/forum/viewtopic.php?p=306819

the code i post falls under the:
WTFYW license
, wich meens its free to use
Back to top
View user's profile Send private message
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies.    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3 ... 27, 28, 29 ... 68, 69, 70  Next
Page 28 of 70

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group