AutoHotkey Community

It is currently May 26th, 2012, 1:22 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 129 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 9  Next
Author Message
 Post subject:
PostPosted: November 23rd, 2008, 10:03 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Many thanks Chris. :D


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2008, 10:47 pm 
Hi Chris,
thumbs up ! Nice to know you're alive and kicking 8)


Top
  
Reply with quote  
 Post subject:
PostPosted: November 24th, 2008, 3:26 am 
Offline

Joined: November 8th, 2004, 12:46 am
Posts: 1271
Thanks Chris. :)

One script wouldn't load because the line SetFormat, Float was missing a second parameter. Omitting it used to default to 0.0.

_________________
"Anything worth doing is worth doing slowly." - Mae West
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 24th, 2008, 4:52 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Thanks for all the comments.

Serenity wrote:
One script wouldn't load because the line SetFormat, Float was missing a second parameter. Omitting it used to default to 0.0.
I'd noticed that the last parameter was unintentionally allowed to be omitted. I chanaged it to manadatory because it's always been listed that way in the documentation. Hopefully it won't inconvenience too many people (if so, it can be easily changed back).


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 24th, 2008, 9:22 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
Excellent!
Chris wrote:
However, taking the address of a variable (e.g. &var) permanently marks that variable as uncacheable because it allows the user to read/write its contents in unconventional ways.
How does this tie in with ByRef parameters?
Quote:
Alternatively, using "SetFormat Float" anywhere in the script (e.g. SetFormat, Float, 0.6) disables caching of floating point numbers,
Is it possible to display more than 6 digits of precision without using SetFormat?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 24th, 2008, 2:02 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Lexikos wrote:
How does this tie in with ByRef parameters?
Taking the address of a ByRef parameter marks the underlying variable as permanently uncacheable. If this becomes an issue for anyone, perhaps a way can be added to manually re-enable caching on a variable; alternatively, perhaps LowLevel could do this by removing the flag from the mAttrib of the variable.

Lexikos wrote:
Is it possible to display more than 6 digits of precision without using SetFormat?
I was thinking of adding a new mode such as SetFormat, FloatFast, 0.6 that would leave caching enabled, but explain in the documentation that this would cause SetFormat to have potentially delayed effects; i.e. only when the script demands the text contents of a variable would SetFormat be applied. For example, concatenating a numeric variable or displaying one with MsgBox would force the data in the cache to be written out as text, and whichever SetFormat happens to be in effect at that time would be obeyed under such a system.

By the way, I realize these beta changes will affect your LowLevel routines, but hopefully the changes won't be hard to incorporate. Two of the main changes are adding 8 bytes to the Var class for a cached int64/double, and adding 4-byte pointer to ArgStruct for the pre-built postfix array. Perhaps LowLevel can call the new function Line::ExpressionToPostfix() to create the postfix array dynamically for any arg that's an expression.

Edit: Fixed typos.


Last edited by Chris on November 24th, 2008, 3:31 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 24th, 2008, 2:45 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
Thanks for the reply.
Chris wrote:
Taking the address of a ByRef parameter marks the underlying variable as permanently uncachable.
I see - I was of the misconception that the mere presence of &var in the code - at load-time - marked var as uncacheable, but it makes more sense to do it at run-time.
Quote:
By the way, I realize these beta changes will affect your LowLevel routines,
I expected such changes to be made. In fact, I made a similar breaking change to AutoHotkey_L when I introduced the debugging features.
Quote:
Perhaps LowLevel can call the new function Line::ExpressionToPostfix() to create the postfix array dynamically for any arg that's an expression.
I'm not aware of any reliable way to retrieve a pointer to a C++ function, other than built-in functions via Func structures. I intended to add built-in functionality for "dynamic scripting" to AutoHotkey_L, but I have other priorities.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 24th, 2008, 3:54 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Lexikos wrote:
I was of the misconception that the mere presence of &var in the code - at load-time - marked var as uncacheable, but it makes more sense to do it at run-time.
This made me realize that the "don't cache" flag can be removed whenever the address of a variable's mContents changes (e.g. via VarSetCapacity). I'll look into doing that.

Lexikos wrote:
I'm not aware of any reliable way to retrieve a pointer to a C++ function, other than built-in functions via Func structures.
If it would help, it might not be too hard to change Line::ExpressionToPostfix(ArgStruct &aArg) to be a global function like ::ExpressionToPostfix(Line &aLine, ArgStruct &aArg)

Lexikos wrote:
I intended to add built-in functionality for "dynamic scripting" to AutoHotkey_L, but I have other priorities.
I've some interest in it as well, though probably lack your appreciation of the extent of the changes that would be necessary (most of which have already been documented and implemented via LowLevel).


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 24th, 2008, 5:06 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Chris wrote:
these beta changes will affect [Lexikos'] LowLevel routines
They do. My pop-up calculator, the three-line calculator and my all other scripts using LowLevel crash at start.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 24th, 2008, 5:27 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
I've updated the top post to indicate that LowLevel & dynamic code doesn't yet work with this beta version.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 24th, 2008, 6:31 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
Thank you Chris
i use erictheturtles' ws4ahk quite a bit with attatchmate.
i notice with the beta if i pas an ahk variable to the vb code stored within a multiline variable like so
Code:
ahkvar=sometext
vb=
(
msgbox "%ahkvar%
)
WS_Exec(vb)
that the ahkvar isnt read unless there is a short sleep(10ms) between the setting of the variable ahkvar and the update to the multiline within vb
This leads me to beleive tho i dont have time to test more thouroghly right now that there is some sort of delay writing the contents of ahkvar to a multiline variable

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 24th, 2008, 7:10 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
There is no delay when writing a non-numeric string to a variable.

By contrast, writing a number to a variable (e.g. Var := 123) stores it as a binary number in a new part of the variable without altering the previous text in that variable (if any). This can be overridden using a quoted string like Var := "123".

However, the delay above isn't a delay from the script's point-of-view because whenever the script asks for the variable as text (including &var), any pending binary number is immediately written out to the text contents of the variable.

Maybe this has something to do with concurrency and multithreading, especially on systems that have more than one CPU.

If you haven't already, maybe you could notify erictheturtle and/or mention this in the ws4ahk topic in case he can shed more light on it. Hopefully a solution can be found that doesn't impact the performance of ws4ahk.

Thanks.


Top
 Profile  
Reply with quote  
 Post subject: thank you
PostPosted: November 24th, 2008, 9:44 pm 
Offline

Joined: November 5th, 2007, 7:25 pm
Posts: 454
Location: canada
I just want to say thank you for Autohotkey.
I hope to see more of you around (if time permits).

Again thank you.

_________________
-=Raz=-


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 24th, 2008, 10:45 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
Chris wrote:
If it would help, it might not be too hard to change Line::ExpressionToPostfix(ArgStruct &aArg) to be a global function like ::ExpressionToPostfix(Line &aLine, ArgStruct &aArg).
I don't think it would help.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 26th, 2008, 7:31 pm 
Offline

Joined: December 7th, 2005, 8:29 am
Posts: 345
Great job as allways!

Good to hear from you chris!

_________________
(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 129 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 9  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot 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