AutoHotkey Community

It is currently May 27th, 2012, 6:38 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 741 posts ]  Go to page Previous  1 ... 11, 12, 13, 14, 15, 16, 17 ... 50  Next
Author Message
 Post subject:
PostPosted: April 14th, 2011, 1:45 pm 
Offline

Joined: October 31st, 2010, 3:02 am
Posts: 87
Thank you for your explain! :oops:

BTW:
Code:
if WinExist("not exist")
   MsgBox yes

WinExist("not exist") return a value "0x0", but "if statement" treat it as true, which seems irrational! If I misunderstand again, hope not offend you by my stupid. :(


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2011, 2:35 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
Alpha 5 and earlier treat all non-empty string values as true. v1 does this, but only for quoted string literals. This was documented in my first post. However, I intended to change it after reluctantly agreeing with jaco0646's comment on page 2. I even thought I had changed it at some point while I was updating my first post, and I consequently revised the related notes. I tested it at the time, but "unfortunately" If ("0") is optimized to avoid the expression evaluator, so it behaves differently to If ("0" . ""). :oops:

(In case it wasn't obvious, WinExist() returns a hexadecimal string.)

I've uploaded v2.0-a006-68e48e0 to fix this and sync with v1.0.97.02.


Last edited by Lexikos on April 14th, 2011, 2:36 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2011, 2:36 pm 
I was not specifically trying to make it a mess. That is just the way I understood it would work right now as I was unaware that the first method you listed would work. So in the current alpha I have to escape possible variable causing characters even in something specifically designated as string?

I'm sure either way the method you choose will probably make more sense to new users. I just fear its going to mean a mess for the thousands of us that would have to manually convert our scripts to join them.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2011, 2:42 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
LiquidGravity logged off wrote:
I just fear its going to mean a mess for the thousands of us that would have to manually convert our scripts to join them.
Breaking compatibility is more or less the point of this release, and why it is labelled v2.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2011, 3:48 pm 
That's all fine and dandy and I agree many things should be fixed but as specked out now there will be no incentive (new features) and much disincentive (debugging) for anyone with v1 scripts to "upgrade" to v2.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2011, 5:01 pm 
Offline

Joined: March 27th, 2008, 2:14 pm
Posts: 700
LiquidGravity logged off wrote:
That's all fine and dandy and I agree many things should be fixed but as specked out now there will be no incentive (new features) and much disincentive (debugging) for anyone with v1 scripts to "upgrade" to v2.
It's rather obvious that the "upgrade" path from v1 scripts to v2 will be difficult. It will be more along the lines of "rewrite." This is natural given the very large usability improvements and disambiguating changes -- with this new functionality you would *want* to rewrite it to take advantage of new features.

_________________
Scripts - License


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2011, 5:34 pm 
Offline
User avatar

Joined: November 2nd, 2008, 4:23 pm
Posts: 2906
Location: 127.0.0.1
LiquidGravity logged off wrote:
I just fear its going to mean a mess for the thousands of us that would have to manually convert our scripts to join them.
I hope this isn't the case. I have started a converter script to help people get their scripts from v1 to v2 easier. I'll try to find time to update it to match the changes in the recent releases soon.

Script Converter: http://www.autohotkey.com/forum/viewtopic.php?t=70291

@infogulch: If people want to take advantage of the new features, yes they would have to learn them and implement them.

Maybe a tutorial on some of the new features and changes when things settle down?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2011, 5:59 pm 
Offline
User avatar

Joined: February 28th, 2011, 7:28 pm
Posts: 625
Location: Germany
small bug / different behavior:
Code:
Gui Show, Maximize
occupies the whole screen including the taskbar, even together with
Code:
Gui +MaximizeBox


Regards
maul.esel

_________________
RECOMMENDED: AutoHotkey_L
Image
github - ImportTypeLib
Win7 HP SP1 32bit | AHK_L U 32bit


Last edited by maul.esel on April 23rd, 2011, 10:40 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2011, 6:35 pm 
Offline

Joined: November 28th, 2009, 4:45 am
Posts: 3089
Lexikos wrote:
At the moment I'm inclined to keep the double-percent-sign method, but %(var) would be more consistent; i.e. because each % would introduce exactly one variable. Instead of "%var1%%var2%_%var3" you could write "%var1%(var2)_%var3".

I think single % will lead to abmiguity
Code:
ms:=5
msms:=10
MsgBox %msms ; should you get 5ms or 10
MsgBox %ms%ms ; should you get 5ms or 55
MsgBox %(ms)ms ; would not be ambiguous but you have to type 3 characters instead of the two you needed when there was only %%


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2011, 6:39 pm 
Offline

Joined: October 2nd, 2009, 12:43 pm
Posts: 283
Remove double %, introduce %().
No ambiguity.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2011, 6:41 pm 
Offline

Joined: April 8th, 2008, 1:08 am
Posts: 100
Location: Minnesota, USA
flak wrote:
Remove double %, introduce %().
No ambiguity.


+1

_________________
-trueski-


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2011, 6:48 pm 
Offline

Joined: March 27th, 2008, 2:14 pm
Posts: 700
flak wrote:
Remove double %, introduce %().
No ambiguity.
The nice thing about this is that since whatever is in %() can be interpreted as an expression it would result in exactly one way to dereference a variable: in an expression.

_________________
Scripts - License


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2011, 6:53 pm 
Offline

Joined: April 8th, 2008, 1:08 am
Posts: 100
Location: Minnesota, USA
infogulch wrote:
flak wrote:
Remove double %, introduce %().
No ambiguity.
The nice thing about this is that since whatever is in %() can be interpreted as an expression it would result in exactly one way to dereference a variable: in an expression.


What are your thoughts on making % required for every variable reference. for example:
Code:
%Variable := "New Var"
MsgBox, %Variable ;displays New Var
MsgBox(%Variable)


The %() would be used for all dynamic references. I don't really have an opinion on this, but am interested in others' thoughts.

_________________
-trueski-


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2011, 7:19 pm 
Offline

Joined: March 27th, 2008, 2:14 pm
Posts: 700
trueski wrote:
What are your thoughts on making % required for every variable reference.
This has been covered before in this topic and found impossible because the ability to dereference the target of an assignment must be maintained.

I think you misunderstood me anyway.
Code:
var := "appended text"
MsgBox, literal text %(var)
MsgBox("literal text %(var)")
MsgBox("literal text " var)

MsgBox, literal text %(var . "added text")
MsgBox("literal text %(var . "added text")")
MsgBox("literal text " var . "added text")

varTwo := "second appended text"

name := "var"
MsgBox("already an expression " . %(name))  ; this is how you would *double* deref

name := "varTwo"
MsgBox("already an expression " . %(name))

Everything from the starting ( to the end ) would be an expression, this includes just getting the value of a variable like %(var) or something more complicated like inside text: %(var "index: " A_Index) or double-dereferencing inside an expression: %(varName)

_________________
Scripts - License


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2011, 7:47 pm 
Offline
User avatar

Joined: November 2nd, 2008, 4:23 pm
Posts: 2906
Location: 127.0.0.1
infogulch wrote:
flak wrote:
Remove double %, introduce %().
No ambiguity.
The nice thing about this is that since whatever is in %() can be interpreted as an expression it would result in exactly one way to dereference a variable: in an expression.
+1 to both points. I remember when I started using AHK (before AHK_L) I couldn't figure out why %1+2% didn't work...it would be great to see expressions within strings.

None wrote:
Code:
MsgBox %ms%ms ; should you get 5ms or 55
I had to try that out, I had no idea what output it would give :?

_________________
aboutscriptappsscripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 741 posts ]  Go to page Previous  1 ... 11, 12, 13, 14, 15, 16, 17 ... 50  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo and 21 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