AutoHotkey Community

It is currently May 27th, 2012, 5:54 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 ... 51, 52, 53, 54, 55, 56, 57 ... 70  Next
Author Message
 Post subject:
PostPosted: September 5th, 2010, 2:21 pm 
Offline

Joined: January 8th, 2007, 1:14 pm
Posts: 83
Thanks for the update :!:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 6th, 2010, 9:23 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Thx for static update. Its finally like it should be.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 6th, 2010, 3:32 pm 
Offline

Joined: July 30th, 2007, 11:32 pm
Posts: 581
:shock:

Awesome updates!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 6th, 2010, 4:15 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
So, I can have N autorun sections:

Code:
AutoRunSection1()
{
   static _ := AutoRunSection1()
   msgbox %A_ThisFunc%
}


AutoRunSection2()
{
   static _ := AutoRunSection2()
   msgbox %A_ThisFunc%
}


...

AutoRunSectionN()
{
   static _ := %A_ThisFunc%()   ;this doesn't work.
   msgbox %A_ThisFunc%
}

Perhaps this could be added as extra keyword, for instance "autorun". This way the purpose is much more clear.

Code:
AutoRunSection1()
{
     autorun
     msgbox %A_ThisFunc%
}

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Memory
PostPosted: September 6th, 2010, 7:32 pm 
Offline

Joined: May 21st, 2007, 11:12 pm
Posts: 34
  • [Great work!!
  • Any plans in the future to lower the footprint? It takes about double of memory for the standard script compared to Autohotkey. It's not the most important thing, but I was wondering if this is the result of it being fresh and that it might get a footprint improvement update or not..


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 6th, 2010, 10:33 pm 
Offline

Joined: January 8th, 2007, 1:14 pm
Posts: 83
Wondering why the following two ways of setting value do not work the same?

Code:
obj := Object()
obj.test.var := "does not work"
obj["test", "var"] := "works"


This was a bit of a "trap" for me because you can get the value using the "dot syntax" but not set it. The later method apparently works because it creates the "sub-objects" as necessary while the first one does not. Am i wrong to assume that it would be more "newbie" friendly (like me) for the first method to work equal to the second?

If i'm sounding confused, it is because i am. ;)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 6th, 2010, 10:48 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
majkinetor wrote:
static _ := %A_ThisFunc%() ;this doesn't work.
The function isn't running when the static initializer is evaluated. Static initializers are simply prepended to the auto-execute section (after variable references are resolved).
Quote:
Perhaps this could be added as extra keyword, for instance "autorun".
Auto-execution isn't the main reason for static initializers, but since it works, I'd rather not add any new syntax.

RUBn wrote:
Any plans in the future to lower the footprint?
No.
Quote:
It takes about double of memory for the standard script compared to Autohotkey.
I don't know what you call a "standard" script. For AHKControl, I see about 100KB higher Working Set size and roughly the same Private Working Set. I couldn't test my other "resident" scripts since they rely on AutoHotkey_L features. For a mostly empty script #including CLR.ahk and COM.ahk, the increase is 1MB / 600KB on the Unicode build and 300KB / 300KB on the ANSI build. Strings in the Unicode build necessarily take up twice as much memory; that's the cost of Unicode support. Also, it's my understanding that the Working Set is shared with other processes.

Note that whichever build you use, memory usage is slightly lower if you decompress AutoHotkey.exe (upx.exe -d AutoHotkey.exe), except for the x64 build, which can't be (easily) decompressed.
Quote:
It's not the most important thing, but I was wondering if this is the result of it being fresh and that it might get a footprint improvement update or not..
AutoHotkey_L is still mostly AutoHotkey, so there isn't much room for improvement. If I see any opportunities, I'll take them (within reason).

Mystiq wrote:
Am i wrong to assume that it would be more "newbie" friendly (like me) for the first method to work equal to the second?
Maybe, but it's not feasible. Would it be more "newbie" friendly for neither one to do anything automatic? My reasoning was that x[y,z] looks like multi-dimensional array syntax, so should act like it. See Arrays of Arrays.
Code:
;pseudo-code

obj.test.var := "abc"
; resolves to two separate actions:
temp := _objget(obj, "test")
_objset(temp, "var", "abc")

obj["test", "var"] := "abc"
; resolves to one action:
_objset(obj, "test", "var", "abc")

obj.test["var"] := "abc"
; is the same as the one above


Report this post
Top
 Profile  
Reply with quote  
 Post subject: two issues
PostPosted: September 8th, 2010, 2:06 pm 
Offline

Joined: March 23rd, 2006, 2:20 pm
Posts: 128
1.

Code:
FOLDER = %A_ScriptDir%\DATA
If (FOLDER <> "%A_ScriptDir%\DATA") And (VAR = "")
   MsgBox BUG ?


2.
Any compiled script (from the last 3 versions): TR/Dropper.Gen
(I know this is the AntiVir problem, but even so...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 8th, 2010, 2:22 pm 
OOPS!!
The correct one
Code:
FOLDER = %A_ScriptDir%\DATA
If (FOLDER <> A_ScriptDir . "\DATA") And (VAR = "")
   MsgBox BUG ?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 8th, 2010, 2:24 pm 
Offline

Joined: March 23rd, 2006, 2:20 pm
Posts: 128
Thank you !


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 8th, 2010, 9:15 pm 
Offline

Joined: January 8th, 2007, 1:14 pm
Posts: 83
Lexikos wrote:
Mystiq wrote:
Am i wrong to assume that it would be more "newbie" friendly (like me) for the first method to work equal to the second?
Maybe, but it's not feasible. Would it be more "newbie" friendly for neither one to do anything automatic? My reasoning was that x[y,z] looks like multi-dimensional array syntax, so should act like it. See Arrays of Arrays.
Code:
;pseudo-code

obj.test.var := "abc"
; resolves to two separate actions:
temp := _objget(obj, "test")
_objset(temp, "var", "abc")

obj["test", "var"] := "abc"
; resolves to one action:
_objset(obj, "test", "var", "abc")

obj.test["var"] := "abc"
; is the same as the one above


Being automatic seems better as it is more obvious i think.

Is there other language(s) that have similar implementation of objects as you have done for AHK_L? If this is a dumb question, don't hesitate to say so. :)

Thanks!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 8th, 2010, 9:23 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
AHK_L object model is inspired by Lua programming language (see tables and metatables). AHK_L Get is equivalent to Lua's index, Set equals to newindex and Call is in Lua named the same. AHK_L adopted only those basic metatable operators while Lua has many of them, for instance math operators that give object meaning in usual mathematical context.

I already proposed that AHKL should follow Lua completely in this manner, however, Lexikos doesn't seem interested for now. Altho I don't agree I can understand his choice due to the big difference between those langugages - Lua is general purpose scripting language while AHKL is domain specific one and its accent is not on the language sophistication but on automation and easy to use features. Also, AHKL must maintain AHK legacy for script compatibility and vanilla AHK is pretty much one of the worst languages around.

_________________
Image


Last edited by majkinetor on September 9th, 2010, 10:39 am, edited 14 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: two issues
PostPosted: September 8th, 2010, 10:31 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
Quote:
(I know this is the AntiVir problem, but even so...
What do you expect me to do about it?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 9th, 2010, 7:05 pm 
Offline

Joined: March 23rd, 2006, 2:20 pm
Posts: 128
Quote:
Quote:
(I know this is the AntiVir problem, but even so...

What do you expect me to do about it?


To let me hope that maybe that wouldn't be the case in a futur version of AutoHotkey_L (like before the last three versions); otherwise it doesn't make much sense for me to only script for myself!


Report this post
Top
 Profile  
Reply with quote  
PostPosted: September 12th, 2010, 12:32 pm 
Offline

Joined: March 23rd, 2006, 2:20 pm
Posts: 128
File Object doesn't provide an immediate interface for inserting/deleting text in a file, so I did the following:

Code:
file := FileOpen("filename.txt", "rw")
File.Seek(540)
string := "< inserted text >" . File.Read()
File.Seek(540)
File.Write(string)


It works but the fact that File.Seek(540) must be used twice make me doubt this is optimal (?)


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 ... 51, 52, 53, 54, 55, 56, 57 ... 70  Next

All times are UTC [ DST ]


Who is online

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