| View previous topic :: View next topic |
| Author |
Message |
namazu(catfish) Guest
|
Posted: Sun Jan 16, 2005 7:58 am Post subject: traditional concatinate on 1.0.25 |
|
|
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
|
Posted: Sun Jan 16, 2005 8:06 am Post subject: |
|
|
| It works fine on my system, running 1.0.25 and XP Pro. |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1717
|
Posted: Sun Jan 16, 2005 8:49 am Post subject: |
|
|
confirmed. running official 1.0.25 on XPSP2.
i'll just get the latest pre1.0.26 and post the findings... _________________
 |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1717
|
Posted: Sun Jan 16, 2005 9:01 am Post subject: |
|
|
still the same. i faced the same problem yesterday and thought it was something bad with my script! _________________
 |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2391
|
Posted: Sun Jan 16, 2005 9:06 am Post subject: |
|
|
| Same problem with the latest version (XP Pro) here. |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 3004 Location: Minnesota
|
Posted: Sun Jan 16, 2005 9:10 am Post subject: |
|
|
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 |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2391
|
Posted: Sun Jan 16, 2005 9:28 am Post subject: |
|
|
| jonny wrote: | | Code: | F1::
test =
test := test "foo"
test := test "bar"
MsgBox, %test%
return |
Tested and working. (1.0.25, XP Pro) |
Works here  |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1717
|
Posted: Sun Jan 16, 2005 9:43 am Post subject: |
|
|
oh boy!... dunno how many of my scripts are affected!  _________________
 |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sun Jan 16, 2005 3:09 pm Post subject: |
|
|
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 |
|
 |
namazu(catfish) Guest
|
Posted: Sun Jan 16, 2005 4:44 pm Post subject: |
|
|
I confirmed this problem was fixed on new version.
Thank you Chris! |
|
| Back to top |
|
 |
|