| Author |
Message |
Forum: Support Topic: Passing Arrays to a function |
| goxu |
|
Posted: June 15th, 2009, 6:54 am
|
|
Replies: 6 Views: 452
|
| thanks jaco, I never imagined it could be done that way. So, here is my script which checks if a passed array contains repeated elements. Regarding the line 14 and 16, why couldn't they be written in an usual way like %arrayname0% and arrayname%A_Index%? 01: colors = red`nblue`ngreen`nred`n 02: Stri... |
|
 |
Forum: Support Topic: Traditional and Expression Methods |
| goxu |
|
Posted: June 15th, 2009, 6:43 am
|
|
Replies: 7 Views: 584
|
| thanks tnl, I might use it. I've encountered another confusing thing. eval := a if (eval = a) MsgBox True else MsgBox False This returns true. eval := a What does this mean? In the Jaco's linked page, Tuncay says is also a calculation. eval := a if eval MsgBox True else MsgBox False This ret... |
|
 |
Forum: Support Topic: Passing Arrays to a function |
| goxu |
|
Posted: June 15th, 2009, 3:24 am
|
|
Replies: 6 Views: 452
|
No, I mean I'd like to retrive the array elements in the function.
In this case, I've expected the code above would return 'red' because %passed_array1% corresponds to %color_array1%, but it doesn't. |
|
 |
Forum: Support Topic: Passing Arrays to a function |
| goxu |
|
Posted: June 15th, 2009, 2:39 am
|
|
Replies: 6 Views: 452
|
| Hi, I'm wondering if it is possible to pass arrays to a custom function. 01: colors = red`nblue`ngreen 02: StringSplit, color_array, colors, `n 03: 04: process_array(color_array) 05: 06: process_array(passed_array) 07: { 08: global 09: MsgBox %passed_array1% 10: ;MsgBox %color_a... |
|
 |
Forum: Support Topic: Traditional and Expression Methods |
| goxu |
|
Posted: June 15th, 2009, 2:05 am
|
|
Replies: 7 Views: 584
|
| Thank you both for your replies. Still it seems that I have to repeat reading jaco's explanation so many times untill I get used to. So, if I understand it correctly, eval = a if (eval = a) MsgBox True else MsgBox False Since the second line has parenthesis like this, any values in the eval ... |
|
 |
Forum: Support Topic: Traditional and Expression Methods |
| goxu |
|
Posted: June 13th, 2009, 9:27 pm
|
|
Replies: 7 Views: 584
|
| It's quite confusing for me. These return false. ;example1: eval = a if eval = a OR eval = b MsgBox True else MsgBox False ;example2: eval = a if (eval = a) OR (eval = b) MsgBox True else MsgBox False And this returns true. ;example3: eval = a if (eval = "a") OR ... |
|
 |
Forum: Support Topic: Return Array in Function |
| goxu |
|
Posted: June 10th, 2009, 9:32 pm
|
|
Replies: 2 Views: 396
|
| thanks, I'll stick with that. |
|
 |
Forum: Support Topic: Return Array in Function |
| goxu |
|
Posted: June 10th, 2009, 8:03 pm
|
|
Replies: 2 Views: 396
|
Hi, I'd like to make my custom function return an array.
Code: result := return_array(2) MsgBox %result1%
return_array(num) { Array1 := 123 * num Array2 := 456 * num return Array }
How do I retrive 226 in this case? |
|
 |
Forum: Support Topic: ImageSearch with a Different Graphic Board |
| goxu |
|
Posted: June 5th, 2009, 2:04 am
|
|
Replies: 1 Views: 181
|
| Hi, I've recently changed my graphic board and the ImageSearch function in my script started not working. It started working after recapuring images in the new enviroment and replacing them to the old ones. Have anybody had similar problems? I guess it is supposed to be so, then is there a good solu... |
|
 |
Forum: Support Topic: Built-in Variable with function |
| goxu |
|
Posted: May 26th, 2009, 9:16 am
|
|
Replies: 1 Views: 411
|
| Hi, I'm trying to make a function which creates the script's log and hoping a better way of dealing with A_LineNumber. This returns the line number of 6, where the %A_LineNumber% is located. But I'd like to get the linenumber calling the function, in this case 1. 1. syslog("test.")... |
|
 |
Forum: Support Topic: Retriving the Current Line Number |
| goxu |
|
Posted: May 25th, 2009, 12:23 pm
|
|
Replies: 4 Views: 244
|
thanks  |
|
 |
Forum: Support Topic: Retriving the Current Line Number |
| goxu |
|
Posted: May 25th, 2009, 11:58 am
|
|
Replies: 4 Views: 244
|
| Hi, is there a way to output the current line in the script? When creating error messages, I'd like to add the line number with it. For example, 1. test := 0 2. if (test = 1) 3. FileAppend, Error in [color=red]Line 2[/color]'n, .\error.log I coul'nt find a built-in variable for this. |
|
 |
Forum: Support Topic: Random Intervals of Key Strokes |
| goxu |
|
Posted: May 24th, 2009, 3:54 am
|
|
Replies: 5 Views: 438
|
Exellent!
I really appreciate it. |
|
 |
Forum: Support Topic: Random Intervals of Key Strokes |
| goxu |
|
Posted: May 23rd, 2009, 6:43 pm
|
|
Replies: 5 Views: 438
|
hmmmm, got a problem when parsing Keys enclosed in braces, such as {Esc}, {Enter} etc.
I thought a way to replace them with some identical elements such as variables or an array before being parsed and recover them when the substitued character gets parsed. Is that possible? |
|
 |
Forum: Support Topic: Random Intervals of Key Strokes |
| goxu |
|
Posted: May 23rd, 2009, 6:00 pm
|
|
Replies: 5 Views: 438
|
| Thank you for the cool solution. It works very well. |
|
 |
| Sort by: |