Search found 6463 matches

by jeeswg
Yesterday, 13:20
Forum: General Discussion
Topic: What is your way to use K&R style?
Replies: 11
Views: 624

Re: What is your way to use K&R style?

- @guest3456: That just confirms what I said. And I think you're being dishonest. - I always used indentation. But I was still debating style points. Even in recent months, I've made changes, adding more not-strictly-necessary braces than I used to. - I don't mind Allman-style scripts that lack inde...
by jeeswg
Yesterday, 09:05
Forum: General Discussion
Topic: What is your way to use K&R style?
Replies: 11
Views: 624

Re: What is your way to use K&R style?

@guest3456: What happens with you, is when I open up the opportunity for a fun/interesting (and useful) discussion/debate, you misread things as super serious, I thought deliberately, but now I think it just flies over your head. when I have 2 or 3 pairs of curly brackets. It definitely helps in tho...
by jeeswg
Yesterday, 00:46
Forum: Ask For Help
Topic: Having trouble getting accSelect to work Topic is solved
Replies: 2
Views: 172

Re: Having trouble getting accSelect to work Topic is solved

- I usually think of accSelect in relation to items *within* controls e.g. listview controls. - To focus a control, I would use ControlFocus. - You can get the control hWnd for an Acc object via Acc_WindowFromObject, and pass that to ControlFocus. - There's a difference between controls and elements...
by jeeswg
18 Jul 2019, 23:54
Forum: General Discussion
Topic: What is your way to use K&R style?
Replies: 11
Views: 624

Re: What is your way to use K&R style?

- @guest3456: You seem to enjoy exaggerating/misrepresenting trivial moments from *years* ago (this is not the first time), and rubbing it in with phrases like 'were dumb' and 'got mad'. - (Whereas I prefer a friendly ethos, and feel hesitant even to point out minor bugs/typos.) - Either you think y...
by jeeswg
18 Jul 2019, 04:36
Forum: Ask For Help
Topic: Open Folder and Close if already open
Replies: 11
Views: 458

Re: Open Folder and Close if already open

For most paths, there is no trailing backslash.
An exception is the root of the drive e.g. C:\.
by jeeswg
18 Jul 2019, 04:15
Forum: Ask For Help
Topic: Open Folder and Close if already open
Replies: 11
Views: 458

Re: Open Folder and Close if already open

@tmplinshi: One thing to consider is this. Cheers.
RTrim(window.Document.Folder.Self.Path, "\")
by jeeswg
17 Jul 2019, 23:38
Forum: Ask For Help
Topic: Is there any Derivative Function?
Replies: 3
Views: 274

Re: Is there any Derivative Function?

Based on:
changing maxima display to plaintext notation
https://maxima-discuss.narkive.com/Z2WbAdU2/changing-maxima-display-to-plaintext-notation

You can use either of these:

Code: Select all

vScript := "display2d:false$diff(exp(-x)-x,x,1);"
vScript := "tex(diff(exp(-x)-x,x,1));"
by jeeswg
17 Jul 2019, 11:32
Forum: Ask For Help
Topic: Need help to write the good example of using "return" Topic is solved
Replies: 19
Views: 812

Re: Need help to write the good example of using "return" Topic is solved

So, assuming the thread is asking: Are there any legitimate 'return True'/'return False' examples. And, which is better 'return True'/'return False' or 'return 1'/'return 0'. There don't seem to be many/any legitimate simple examples. Thus, it may be necessary to use a contrived example for demonstr...
by jeeswg
17 Jul 2019, 11:11
Forum: Ask For Help
Topic: terminology: statement separator, statement terminator
Replies: 0
Views: 69

terminology: statement separator, statement terminator

The documentation mentions 'statement separator', but not 'statement terminator': Scripting Language | AutoHotkey https://www.autohotkey.com/docs/Language.htm Line breaks are meaningful: Line breaks generally act as a statement separator, terminating the previous command or expression. (A statement ...
by jeeswg
16 Jul 2019, 16:54
Forum: Ask For Help
Topic: Need help to write the good example of using "return" Topic is solved
Replies: 19
Views: 812

Re: Need help to write the good example of using "return" Topic is solved

- I had a look for functions in my function libraries containing 'return 1', but they are typically very complicated. - And of the simpler functions that do use it, I could probably simplify the functions so that they didn't use it. - Some possibilities: AhkForumUrlIsStandard DateIsLeapYear (doesn't...
by jeeswg
16 Jul 2019, 16:14
Forum: Ask For Help
Topic: Need help to write the good example of using "return" Topic is solved
Replies: 19
Views: 812

Re: Need help to write the good example of using "return" Topic is solved

- @swagfag: I think you're saying: WinActive is a bad example because ... converting a non-zero integer (hWnd) to 1 is pointless, because both work identically with if var . - My main point was simply to show how true v. false could be demonstrated succinctly, in one line. - But you mention cmp, whi...
by jeeswg
16 Jul 2019, 14:17
Forum: General Discussion
Topic: What is your way to use K&R style?
Replies: 11
Views: 624

Re: What is your way to use K&R style?

When K&R can/can't be used in AHK v1: {...} (block) - Syntax & Usage | AutoHotkey https://www.autohotkey.com/docs/commands/Block.htm One True Brace (OTB, K&R style): The OTB style may optionally be used in the following places: function definitions, If (expression), Else, Loop Count, While, For, Try...
by jeeswg
16 Jul 2019, 13:59
Forum: Ask For Help
Topic: Need help to write the good example of using "return" Topic is solved
Replies: 19
Views: 812

Re: Need help to write the good example of using "return" Topic is solved

Hmm, well one consideration for demos, is to stick to one idea per demo, and make it as simple as possible. So possible ideas: return WinActive("ahk_class Notepad") ? True : False return WinActive("ahk_class Notepad") ? 1 : 0 return !!WinActive("ahk_class Notepad") My style inclination is to never u...
by jeeswg
16 Jul 2019, 12:46
Forum: Ask For Help
Topic: Need help to write the good example of using "return" Topic is solved
Replies: 19
Views: 812

Re: Need help to write the good example of using "return" Topic is solved

The problems occur because of limitations in the AHK v1 syntax (e.g. commands, IfMsgBox). So I would instead do a style guide for AHK v2. That said, you could cover some AHK v1 examples in an addendum.
by jeeswg
13 Jul 2019, 21:11
Forum: Ask For Help
Topic: Gdiplus screenshot gets black screen with Chrome only
Replies: 2
Views: 178

Re: Gdiplus screenshot gets black screen with Chrome only

Interesting, thanks for sharing.

Something else that may be relevant:
TransColor doesn't work in Chrome - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=60957&p=280208#p280208
Uncheck “Use hardware acceleration when available”.
by jeeswg
13 Jul 2019, 17:35
Forum: Ask For Help
Topic: Newline At End of Clipboard Missing
Replies: 10
Views: 218

Re: Newline At End of Clipboard Missing

You could also use NirSoft InsideClipboard, to inspect the clipboard.
by jeeswg
13 Jul 2019, 16:27
Forum: Scripts and Functions
Topic: trim and merge 4k video lossless
Replies: 3
Views: 304

Re: trim and merge 4k video lossless

- To get the video path, I might: - Get the window title via WinGetTitle, perhaps setting it to be the name/full path. - Compare the name from the window title with shortcuts in the Recent folder, using FileGetShortcut. - Perhaps recently played files are stored in the registry, or somewhere else, s...
by jeeswg
13 Jul 2019, 16:22
Forum: Ask For Help
Topic: Newline At End of Clipboard Missing
Replies: 10
Views: 218

Re: Newline At End of Clipboard Missing

- I find Gmail and other places can be a bit odd with handling CR/LFs. - E.g. if you do this: Clipboard := "abc" , does your program add a line break at the end, when you paste. - I.e. you could do various experiments to try to uncover what the situation is. - You could also try copying the text, an...
by jeeswg
13 Jul 2019, 15:15
Forum: Ask For Help
Topic: Newline At End of Clipboard Missing
Replies: 10
Views: 218

Re: Newline At End of Clipboard Missing

The first script shows that lone CR/LF characters display in a MsgBox. So, any line break character might be a different line break character. The second script lists any non-letters/non-numbers. q:: ;test CR and LF in MsgBox MsgBox, % "a`nb" MsgBox, % "a`rb" return w:: ;list special characters vTex...
by jeeswg
13 Jul 2019, 14:25
Forum: Ask For Help
Topic: Newline At End of Clipboard Missing
Replies: 10
Views: 218

Re: Newline At End of Clipboard Missing

Any reason for the m (multiline) option? Some things to try. Cheers. Clipboard := "abc`r`n" Pos := RegExMatch(Clipboard, "\R$") MsgBox % "Newline Position: " Pos ;4 Pos := RegExMatch(Clipboard, "`r`n$") MsgBox % "Newline Position: " Pos ;4 Pos := RegExMatch(Clipboard, "`r$") MsgBox % "Newline Positi...

Go to advanced search