AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

traditional concatinate on 1.0.25

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
namazu(catfish)
Guest





PostPosted: Sun Jan 16, 2005 7:58 am    Post subject: traditional concatinate on 1.0.25 Reply with quote

I wrote the following script in authotkey.ini on 1.0.25

F1::
test =
test = %test% foo
test = %test% bar
MsgBox, %test%
return

Then, I pressed F1, "foo bar" was displayed.
But, second time I pressed F1, only "foo" was displayed.

It was no problem before 1.0.24.
Back to top
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Sun Jan 16, 2005 8:06 am    Post subject: Reply with quote

It works fine on my system, running 1.0.25 and XP Pro.
Back to top
View user's profile Send private message
Rajat



Joined: 28 Mar 2004
Posts: 1717

PostPosted: Sun Jan 16, 2005 8:49 am    Post subject: Reply with quote

confirmed. running official 1.0.25 on XPSP2.
i'll just get the latest pre1.0.26 and post the findings...
_________________
Back to top
View user's profile Send private message
Rajat



Joined: 28 Mar 2004
Posts: 1717

PostPosted: Sun Jan 16, 2005 9:01 am    Post subject: Reply with quote

still the same. i faced the same problem yesterday and thought it was something bad with my script!
_________________
Back to top
View user's profile Send private message
corrupt



Joined: 29 Dec 2004
Posts: 2391

PostPosted: Sun Jan 16, 2005 9:06 am    Post subject: Reply with quote

Same problem with the latest version (XP Pro) here.
Back to top
View user's profile Send private message Visit poster's website
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Sun Jan 16, 2005 9:10 am    Post subject: Reply with quote

Looking at the documentation, I suggest you try the new method of concatenation Chris has suggested:

Quote:
In the absence of an operator, adjacent strings and literal numbers are merged.
Example (new method): Var := "The color is " FoundColor "."
Example (traditional method; note the use of equals vs. colon-equals): Var = The color is %FoundColor%.

Currently, sub-expressions and references such as Array%i% cannot be merged with other items. An attempt to merge a sub-expression such as "Prefix" (x + 1) will cause the entire expression to evaluate to an empty string. An attempt to merge a reference such as Array%i% "Suffix" will treat Array%i% as an empty string.


To make it this:

Code:
F1::
test =
test := test "foo"
test := test "bar"
MsgBox, %test%
return


Tested and working. (1.0.25, XP Pro)
Back to top
View user's profile Send private message
corrupt



Joined: 29 Dec 2004
Posts: 2391

PostPosted: Sun Jan 16, 2005 9:28 am    Post subject: Reply with quote

jonny wrote:
Code:
F1::
test =
test := test "foo"
test := test "bar"
MsgBox, %test%
return


Tested and working. (1.0.25, XP Pro)

Works here Smile
Back to top
View user's profile Send private message Visit poster's website
Rajat



Joined: 28 Mar 2004
Posts: 1717

PostPosted: Sun Jan 16, 2005 9:43 am    Post subject: Reply with quote

oh boy!... dunno how many of my scripts are affected! Shocked
_________________
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Sun Jan 16, 2005 3:09 pm    Post subject: Reply with quote

Thanks for reporting it and sorry for any trouble it caused you.

This has been fixed and the installer has been updated.

I believe this affected only concatenations that required one or more spaces to be trimmed from the left side due to AutoTrim being ON. In the case of test = %test% foo, the problem appeared when test was blank and the space after it was trimmed as a result of AutoTrim. The problem didn't show up until the next command because test's length was interally stored wrong, which was harmless until some future operation actually tried to use the length for something.
Back to top
View user's profile Send private message Send e-mail
namazu(catfish)
Guest





PostPosted: Sun Jan 16, 2005 4:44 pm    Post subject: Reply with quote

I confirmed this problem was fixed on new version.
Thank you Chris!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group