| View previous topic :: View next topic |
| Author |
Message |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4653 Location: AHK Forum
|
Posted: Sun Nov 23, 2008 9:03 pm Post subject: |
|
|
Many thanks Chris.  |
|
| Back to top |
|
 |
BoBo² Guest
|
Posted: Sun Nov 23, 2008 9:47 pm Post subject: |
|
|
Hi Chris,
thumbs up ! Nice to know you're alive and kicking  |
|
| Back to top |
|
 |
Serenity
Joined: 07 Nov 2004 Posts: 1271
|
Posted: Mon Nov 24, 2008 2:26 am Post subject: |
|
|
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
 |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10716
|
Posted: Mon Nov 24, 2008 3:52 am Post subject: |
|
|
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). |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7299 Location: Australia
|
Posted: Mon Nov 24, 2008 8:22 am Post subject: |
|
|
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? |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10716
|
Posted: Mon Nov 24, 2008 1:02 pm Post subject: |
|
|
| 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 Mon Nov 24, 2008 2:31 pm; edited 1 time in total |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7299 Location: Australia
|
Posted: Mon Nov 24, 2008 1:45 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10716
|
Posted: Mon Nov 24, 2008 2:54 pm Post subject: |
|
|
| 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). |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4710 Location: Boulder, CO
|
Posted: Mon Nov 24, 2008 4:06 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10716
|
Posted: Mon Nov 24, 2008 4:27 pm Post subject: |
|
|
| I've updated the top post to indicate that LowLevel & dynamic code doesn't yet work with this beta version. |
|
| Back to top |
|
 |
tank
Joined: 21 Dec 2007 Posts: 3700 Location: Louisville KY USA
|
Posted: Mon Nov 24, 2008 5:31 pm Post subject: |
|
|
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 _________________
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed; |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10716
|
Posted: Mon Nov 24, 2008 6:10 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Razlin
Joined: 05 Nov 2007 Posts: 454 Location: canada
|
Posted: Mon Nov 24, 2008 8:44 pm Post subject: thank you |
|
|
I just want to say thank you for Autohotkey.
I hope to see more of you around (if time permits).
Again thank you. _________________ -=Raz=- |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7299 Location: Australia
|
Posted: Mon Nov 24, 2008 9:45 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
twhyman
Joined: 07 Dec 2005 Posts: 339
|
Posted: Wed Nov 26, 2008 6:31 pm Post subject: |
|
|
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.
|
|
| Back to top |
|
 |
|