Search found 282 matches

by john_c
Today, 08:59
Forum: Ask For Help
Topic: Difference between Send and remapping Topic is solved
Replies: 2
Views: 100

Difference between Send and remapping Topic is solved

Can anybody show the difference between Send and remapping? Can we say that one approach is generally better than another?

Code: Select all

a:: Send, b
b:: MsgBox,,, % "B"

x:: y
y:: MsgBox,,, % "Y"
by john_c
16 Oct 2019, 21:47
Forum: General Discussion
Topic: your personal AutoHotkey style guide
Replies: 100
Views: 13922

Re: your personal AutoHotkey style guide

Any opinions about Switch vs If/Else? Just for the record: I never worked with switches before. This thing is completely new for me. One article that I found on the websays that if-else better for boolean values: If-else conditional branches are great for variable conditions that result into a boole...
by john_c
11 Oct 2019, 19:12
Forum: General Discussion
Topic: your personal AutoHotkey style guide
Replies: 100
Views: 13922

Re: your personal AutoHotkey style guide

Update: One advantage of Click over ControlClick is that we have a possibility to check if the coordinates are correct, and how precisely they are specified. When we use ControlClick, the mouse cursor is moved "invisibly" and therefore there is no such possibility. (Of course, we can use additional ...
by john_c
11 Oct 2019, 18:37
Forum: General Discussion
Topic: your personal AutoHotkey style guide
Replies: 100
Views: 13922

Re: your personal AutoHotkey style guide

@jeeswg Thanks. The question about clicks interested me for a long time.
by john_c
11 Oct 2019, 12:09
Forum: General Discussion
Topic: your personal AutoHotkey style guide
Replies: 100
Views: 13922

Re: your personal AutoHotkey style guide

Click and ControlClick:

Can we say that one of them is better for average not-gamer?
by john_c
03 Oct 2019, 15:51
Forum: General Discussion
Topic: your personal AutoHotkey style guide
Replies: 100
Views: 13922

Re: your personal AutoHotkey style guide

Another case to take into account:

* normal loops,
* normal loops with Until,
* While-loops.

Code: Select all

Loop, 5
{
    i += 1
    MsgBox,,, % i
}

Code: Select all

Loop
{
    i += 1
    MsgBox,,, % i
} Until i = 5

Code: Select all

While i < 5
{
    i += 1
    MsgBox,,, % i
}
by john_c
03 Oct 2019, 02:02
Forum: General Discussion
Topic: your personal AutoHotkey style guide
Replies: 100
Views: 13922

Re: your personal AutoHotkey style guide

jeeswg From what you said, it seems that the main advantage of Try/Catch is the use of Throw. We cannot use Throw without them. This is a good point, I haven't considered it before. Edit, few days later: > We cannot use Throw without Try/Catch. Of course, it's not correct. We can. Var := True if (V...
by john_c
02 Oct 2019, 08:10
Forum: General Discussion
Topic: your personal AutoHotkey style guide
Replies: 100
Views: 13922

Re: your personal AutoHotkey style guide

Any opinions about Try/Catch vs. ErrorLevel? * In some cases Try/Catch is the only possible option. * ... and sometimes the only possible option is ErrorLevel. These cases are out of scope of my question. But what about the cases when both of these ways can accomplish the task? Is one way is better ...
by john_c
30 Sep 2019, 02:27
Forum: Ask For Help
Topic: Mute returns from functions - should we avoid them?
Replies: 6
Views: 500

Re: Mute returns from functions - should we avoid them?

Thanks, it answers my question.
by john_c
29 Sep 2019, 12:35
Forum: General Discussion
Topic: Exit and ExitApp - are they control flow statements?
Replies: 3
Views: 236

Re: Exit and ExitApp - are they control flow statements?

jeeswg > Although one wonders how far one can extend the list of CFS-like commands etc in AHK, perhaps Reload, perhaps Pause/Suspend, perhaps Critical/Thread ...? Hah, it seems the things are more complicated than I assumed. > Did you ask something like this before somewhere? Yes: https://github.co...
by john_c
29 Sep 2019, 12:05
Forum: General Discussion
Topic: Exit and ExitApp - are they control flow statements?
Replies: 3
Views: 236

Exit and ExitApp - are they control flow statements?

Does anybody know for what reason Exit and ExitApp aren't mentioned in the control flow section in the docs ? The section is currently consists of If, Else, GoTo, GoSub, Return, Loop, While, For, Break, Continue, Until, Switch, Try, Catch, Finally, and Throw. There is also " Not Control Flow " secti...
by john_c
27 Sep 2019, 22:34
Forum: Ask For Help
Topic: Mute returns from functions - should we avoid them?
Replies: 6
Views: 500

Re: Mute returns from functions - should we avoid them?

jeeswg > - So, for complete clarity in my functions, I now like to specify return "" and never return (which is equivalent) by itself. I.e. to indicate that a blank string is being returned, and not a null value. Could you provide some real life example? An example which is not from real life, but ...
by john_c
26 Sep 2019, 20:40
Forum: Ask For Help
Topic: Pass string into cmd.exe as forced expression Topic is solved
Replies: 13
Views: 564

Re: Pass string into cmd.exe as forced expression Topic is solved

jeeswg Thanks, I changed the accepted answer to yours. It seems that the most clear version should follow 2 rules: * Always use A_Space instead of normal space in case the space is located close to the quote mark. * Always use """" for escaped quote marks. Thus, the result will be: Run, % ComSpec ....
by john_c
26 Sep 2019, 19:02
Forum: Ask For Help
Topic: Pass string into cmd.exe as forced expression Topic is solved
Replies: 13
Views: 564

Re: Pass string into cmd.exe as forced expression Topic is solved

@flyingDman thanks, works for me, for both spaced and not-spaced files:

Code: Select all

test.html
test test.html
It is strange, however, that /c is not enclosed in quote marks.

The @jeeswg version works for test.html but not for test test.html for now.
by john_c
26 Sep 2019, 18:41
Forum: Ask For Help
Topic: Pass string into cmd.exe as forced expression Topic is solved
Replies: 13
Views: 564

Re: Pass string into cmd.exe as forced expression Topic is solved

@jeeswg But they don't work either :D

At least for me. Win7, AHK 1.1.30.03

Edit: I was wrong, it works.
by john_c
26 Sep 2019, 18:22
Forum: Ask For Help
Topic: Pass string into cmd.exe as forced expression Topic is solved
Replies: 13
Views: 564

Re: Pass string into cmd.exe as forced expression Topic is solved

@flyingDman Your second version is a copy of mine.

Your first version is a slight improvement over it, thanks.

However, I want to use the forced expression. Your examples doesn't use it.
by john_c
26 Sep 2019, 17:22
Forum: Ask For Help
Topic: Pass string into cmd.exe as forced expression Topic is solved
Replies: 13
Views: 564

Pass string into cmd.exe as forced expression Topic is solved

It works: File := A_Desktop . "\test.html" Run, %ComSpec% /c ""C:\Program Files\Google\Chrome\Application\chrome.exe" %File%",, Hide How to write it as forced expression? Here is what I tried: Run, % ComSpec . A_Space . "/c ""C:\Program Files\Google\Chrome\Application\chrome.exe"" . File",, Hide Run...
by john_c
23 Sep 2019, 01:00
Forum: General Discussion
Topic: The performance of the parsing of file contents
Replies: 2
Views: 221

Re: The performance of the parsing of file contents

jeeswg > Try some benchmark tests. Yeah, it's all about benchmark tests. The question is: how to perform them properly. I'm not sure. > E.g. try each technique hundreds/thousands of times, and use A_TickCount before and after. The problem is that I'm trying to check the load on RAM and CPU. Not the...

Go to advanced search