AutoHotkey Community

It is currently May 27th, 2012, 3:12 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 ... 28, 29, 30, 31, 32, 33, 34 ... 70  Next
Author Message
PostPosted: March 23rd, 2010, 10:37 am 
Offline

Joined: November 16th, 2008, 6:08 pm
Posts: 32
I have recently downloaded AutoHotkey_L when searching for unicode in AutoHotkey. So thanks to both, jackieku and Lexicos.

I'm having problems when getting text of StatusBar with "StatusBarGetText". I only get half of the text. Normal AHK works without problem.

Thanks for all your hard work.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 23rd, 2010, 12:39 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
Thanks for the bug report. It'll be fixed in the next update.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 25th, 2010, 9:35 pm 
Offline

Joined: May 24th, 2007, 3:45 am
Posts: 1121
I must be dense. I used this before, and I thought I'd try out the latest version but I can't get it to do anything... at all. It just silently closes when I try to run it. What am I doing wrong?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 25th, 2010, 10:16 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
Is there anything in your %A_MyDocuments%\AutoHotkey.ahk file? AutoHotkey.ini? Have you tried creating a script and dragging it onto the executable?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 26th, 2010, 8:34 am 
Offline

Joined: May 24th, 2007, 3:45 am
Posts: 1121
My Documents\AutoHotkey.ahk does not exist*, but I tried it with or without an AutoHotkey.ini and by dragging a script. Also tried both the unicode and ANSI versions.

Like I said it has me fairly confused, because the last one worked fine (and still does) but this one just quits without even an error. In fact to all appearances it doesn't even start.

*Actually I just tried creating it, but it made no difference.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 26th, 2010, 9:37 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
Are you running both versions from the same location? Is the new file 327,680 bytes (Unicode) or 314,368 bytes (ANSI)? Have you tried downloading again after clearing cache/temporary files? (I just did without any problems.)


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 27th, 2010, 4:28 am 
Code:
; modified http://www.autohotkey.net/~Lexikos/AutoHotkey_L/docs/objects/Enumerator.htm
; MD5 of AutoHotkey_Lw.zip tested w/: 4ed0de81343e3e51adfa91b8c5da00d2

MsgBox % "Greetings!  Thanks so much for the enumeration stuff.`n" . "But I'm finding some of the behavior puzzling.`n" . "Am I doing something wrong?"

obj := Object("red", 0xFF0000, "blue", 0x0000FF, "green", 0x00FF00)
obj2 := Object("cyan", "dunno")

MsgBox % "Ok, so a dump of a 3 pair value object...`n" . "Initialized by providing Object() 3 pairs as in the example code."
enum := obj._NewEnum()
While enum[k, v]
  t .= k "='" v "'`n"
MsgBox % t
MsgBox % "Nice!  Gotta love enumeration!" 
;
MsgBox % "Now let's try enumerating the same object via a subroutine..."
anObj := obj
Gosub, AnotherDump
MsgBox % "Huh?  Why am I seeing double?"
;
MsgBox % "Let's see how we do with an object initialized by providing a single pair to Object()"
enum := obj2._NewEnum()
While enum[k, v]
  t .= k "='" v "'`n"
MsgBox % t
MsgBox % "Woah?  Why does the second object seem to have inherited from the first when 'base' was not specified?"
MsgBox % "May be it's just my lack of understanding...perhaps someone can help me rearrange my thinking."
MsgBox % "P.S. do you think it'd be possible to use some string other than 'base'?  Perhaps '_base' or some such?  Thinking there's a high chance of collision with existing strings coming in from elsewhere..."
Return

AnotherDump:
enum := anObj._NewEnum()
While enum[k, v]
  t .= k "='" v "'`n"
MsgBox % t
Return


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 27th, 2010, 5:15 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
Clear t before reusing it (or make it a local variable so AutoHotkey will clear it for you). :roll:
Code:
t=

Quote:
P.S. do you think it'd be possible to use some string other than 'base'?
I suppose you mean "...to access the base object". It is easily possible, but I do not plan to change it. Whatever string it is, there is a chance of collision. Perhaps in a future version it will not be accessed this way at all, but I find it convenient and readable.
Quote:
Thinking there's a high chance of collision with existing strings coming in from elsewhere...
I think it's not significant enough.

If you think there is a chance your script will use the key "base", use _Insert() to initially set the value. For instance:
Code:
x := Object("base", Object("Test", "Test"))
x.Test(),  x._Insert("base", "foo") ; Create a key-value pair.
x.Test(),  x.base := "bar"          ; Set its value.
x.Test(),  x._Remove("base")        ; Remove the key-value pair.
x.Test(),  x.base := "Invalid"      ; Set the real base property.
x.Test()   ; No effect as base object was removed.
Test(x) {
    MsgBox % "Base is " . (IsObject(b := x.base) ? "{" . &b . "}" : b)
}
This can be done when you set any value with a string key - either explicitly or via __Set - or it can be done when you create the object:
Code:
x := Object("base", RealBaseObject)
x._Insert("base", "")
; RealBaseObject is no longer accessible via x.base.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 27th, 2010, 5:24 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
Quote:
Revision 50 - March 27, 2010
  • Improved flexibility of Object._Insert.
    • Object._Insert(x) - inserts x at the end (i.e. _MaxIndex()="" ? 1 : _MaxIndex() + 1).
    • Object._Insert(i,x,y,z) - inserts x,y,z at i,i+1,i+2.
  • Improved flexibility of Object._Remove.
    • Object._Remove(k) - removes and returns the value associated with k.
    • Object._Remove() - removes and returns the value at _MaxIndex().
  • Added file share mode flags to FileOpen [by jackieku].
  • Fixed: 'P' option of RegExMatch incorrectly output 1 for subpatterns which did not match anything.
  • Fixed: Object._SetCapacity(key,n) was not null-terminating in some cases.
  • Fixed: StatusBarGetText returned only half of the text in Unicode builds.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 27th, 2010, 8:44 am 
Lexikos wrote:
Clear t before reusing it (or make it a local variable so AutoHotkey will clear it for you). :roll:

Indeed!

Thanks for the code and explanation regarding "base" and also for your continued work on AutoHotkey_L.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 28th, 2010, 1:50 am 
Offline

Joined: May 24th, 2007, 3:45 am
Posts: 1121
I think maybe I found out why it wasn't working for me. The first computer I tried it on was a really out of XP box. But I tried it on another XP system that has all the patches and junk and it works on that one. (But older versions AHk_L did work on the old system.) Has anything changed that might account for that?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 28th, 2010, 2:53 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
I don't think so. Which revision worked for you?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 28th, 2010, 5:55 am 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
I'm really enjoying all these updates! Also, I finally learned how to use the RegEx Callouts & the debugging features. Thank you for that functionality :D . I'm gonna have to figure out how to send you money sometime ;) . I noticed the improvements to _Insert() & _Remove() seem more like array-functionality. Are there any plans to incorporate a built-in array object in the future? ( not that you're in competition, but I know IronAHK will have this )

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 28th, 2010, 9:00 am 
Offline

Joined: May 24th, 2007, 3:45 am
Posts: 1121
Lexikos wrote:
I don't think so. Which revision worked for you?

The last one I tried that worked was 1.0.48.3 (date: May 31, 2009) then after having been away a while I tried 1.0.48.5 (date: March 16, 2010), and neither that nor the newest one work on the old system (but they work on fully patched XP).

Of course this is a sample size of 2 so there could well be something else at work here.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 28th, 2010, 10:25 am 
Offline
User avatar

Joined: May 5th, 2007, 7:24 pm
Posts: 1240
Location: Seville, Spain
jethrow wrote:
I noticed the improvements to _Insert() & _Remove() seem more like array-functionality. Are there any plans to incorporate a built-in array object in the future?

I'm not Lexikos, but the new improvements are stack-like, and the current Object feature can also do arrays.

_________________
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  
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 ... 28, 29, 30, 31, 32, 33, 34 ... 70  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 10 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