Search found 47 matches

by fade2gray
03 Feb 2021, 08:52
Forum: Suggestions on documentation improvements
Topic: v2 Documentation: StrReplace example #2 is missing CaseSense parameter
Replies: 1
Views: 114

v2 Documentation: StrReplace example #2 is missing CaseSense parameter

NewStr := StrReplace(Haystack, SearchText [, ReplaceText, CaseSense, OutputVarCount, Limit := -1])

MyString := StrReplace(MyString, "`r`n`r`n", "`r`n", ReplaceCount)
by fade2gray
31 Jan 2021, 12:25
Forum: AutoHotkey v2 Help
Topic: How to implement Gui.Destroy()? Topic is solved
Replies: 3
Views: 111

Re: How to implement Gui.Destroy()? Topic is solved

@kczx3 Thanks, I haven't really got a great understanding of objects, methods and callbacks etc. in v1 yet, but I have a working v1 gui that I'm struggling to convert to v2, which is a requirement for a personal project I'm attempting.
by fade2gray
31 Jan 2021, 10:40
Forum: AutoHotkey v2 Help
Topic: How to implement Gui.Destroy()? Topic is solved
Replies: 3
Views: 111

Re: How to implement Gui.Destroy()? Topic is solved

Figured it. MyGui.Gui.Destroy()
by fade2gray
31 Jan 2021, 10:35
Forum: AutoHotkey v2 Help
Topic: How to implement Gui.Destroy()? Topic is solved
Replies: 3
Views: 111

How to implement Gui.Destroy()? Topic is solved

Code: Select all

MyGui := Gui.New()
MyBtn := MyGui.Add("Button","Default", "OK").OnEvent("Click", "OK_Click")
MyGui.Show()

OK_Click(MyGui, *){
    MsgBox('You clicked the "OK" button.')
    MyGui.Destroy() ;???
}
by fade2gray
31 Jan 2021, 05:31
Forum: Suggestions on documentation improvements
Topic: Document search fuction does not allow for hyphenated words
Replies: 2
Views: 70

Re: Document search fuction does not allow for hyphenated words

Thanks, Highlight Keywords certainly makes it easier to identify hyphenated pairs.
by fade2gray
30 Jan 2021, 19:11
Forum: Suggestions on documentation improvements
Topic: Document search fuction does not allow for hyphenated words
Replies: 2
Views: 70

Document search fuction does not allow for hyphenated words

e.g. side-effect is not a permitted search term.
side effect returns side and effect wherever they might appear in the resultant list of pages.
by fade2gray
30 Jan 2021, 18:33
Forum: Bug Reports
Topic: should the ternary operator return an error in this use case? Topic is solved
Replies: 1
Views: 182

should the ternary operator return an error in this use case? Topic is solved

Code: Select all

x := True
y := x = True ? 1 :
if y = 
    MsgBox False
Else
    MsgBox True
by fade2gray
29 Jan 2021, 14:12
Forum: AutoHotkey v2 Help
Topic: FileRead function parameters *must* be in parenthesis
Replies: 4
Views: 88

Re: FileRead function parameters *must* be in parenthesis

swagfag Thanks for the link, but it doesn't help me understand what side effects I might expect if using FileRead filename, "RAW" at the beginning of a line, particularly as the AHK documentation makes no mention of side effects as such. Nothing observable, what side effects might I expect otherwis...
by fade2gray
29 Jan 2021, 09:43
Forum: AutoHotkey v2 Help
Topic: FileRead function parameters *must* be in parenthesis
Replies: 4
Views: 88

Re: FileRead function parameters *must* be in parenthesis

swagfag Unfortunately, the documentation does not give any working example of exclusively using FileRead's side-effects. I thought this might be a side-effect; Buffer objects are typically created by calling BufferAlloc, but can also be returned by FileRead with the "RAW" option. But this doesn't w...
by fade2gray
28 Jan 2021, 19:37
Forum: AutoHotkey v2 Help
Topic: FileRead function parameters *must* be in parenthesis
Replies: 4
Views: 88

FileRead function parameters *must* be in parenthesis

e.g. must be FileRead(filenameVar), not FileRead filenameVar.
by fade2gray
28 Jan 2021, 14:33
Forum: AutoHotkey v2 Help
Topic: RegEx works in v1 but not v2 Topic is solved
Replies: 8
Views: 1105

Re: RegEx works in v1 but not v2 Topic is solved

@HotKeyIt Thanks for sorting out the quoting/escaping issue, but I notice that v2 requires the single-line modifier, whereas it wasn't required in v1, not in the above demo at least.
by fade2gray
28 Jan 2021, 11:59
Forum: AutoHotkey v2 Help
Topic: RegEx works in v1 but not v2 Topic is solved
Replies: 8
Views: 1105

Re: RegEx works in v1 but not v2 Topic is solved

@HotKeyIt & @swagfag

I'm unable to test in the original script as I'm still working through other changes needed, but neither suggestion works for the simplified demo I included.
by fade2gray
28 Jan 2021, 10:35
Forum: AutoHotkey v2 Help
Topic: RegEx works in v1 but not v2 Topic is solved
Replies: 8
Views: 1105

Re: RegEx works in v1 but not v2 Topic is solved

A simplified demo to return "line3" "line5" . multiLineVar := " (LTrim line0 ""line1"" line2 ""line3"" line4 ""line5"" line6 )" RegEx := ".*(?<=\n""line1"").*?(""line3"").*?(""line5"").*" result := RegExReplace(multiLineVar, RegEx, "$1 $2") MsgBox %result% ;v1 ;MsgBox result ;v2
by fade2gray
28 Jan 2021, 08:47
Forum: AutoHotkey v2 Help
Topic: RegEx works in v1 but not v2 Topic is solved
Replies: 8
Views: 1105

Re: RegEx works in v1 but not v2 Topic is solved

The Substitution demonstrates the goal of the RegExReplace.
https://regex101.com/r/UxR5cn/1
by fade2gray
28 Jan 2021, 08:24
Forum: AutoHotkey v2 Help
Topic: RegEx works in v1 but not v2 Topic is solved
Replies: 8
Views: 1105

RegEx works in v1 but not v2 Topic is solved

This regular expression works in a v1 RegExReplace but not in v2 - any pointers as to what's wrong please? Error: Missing space or operator before this. Specifically: "configuration"").*,?("".*?\.executePath"": ).*?(""C:.*?" var "(.*?)?\.exe"").*" ---> 063: RegEx := ".*(?<=\n\t{2}""configuration"")....
by fade2gray
11 Dec 2020, 12:42
Forum: Ask For Help
Topic: Hide command console when using RunWaitOne() example Topic is solved
Replies: 18
Views: 313

Re: Hide command console when using RunWaitOne() example Topic is solved

teadrinker wrote:
11 Dec 2020, 12:22
In some cases the encoding other than CP0 must be specified, so this parameter can be necessary.
Yes, I notice I get a list of Chinese characters if I try using sOutput .= stdOut := StrGet(&sTemp, nSize)

Thank you.
by fade2gray
11 Dec 2020, 12:08
Forum: Ask For Help
Topic: Hide command console when using RunWaitOne() example Topic is solved
Replies: 18
Views: 313

Re: Hide command console when using RunWaitOne() example Topic is solved

No, all what you can remove are the callBackFuncObj := "" parameter and the line ( callBackFuncObj && callBackFuncObj.Call(stdOut) ) . But, I also find that removing the encoding parameter and making this change sOutput .= stdOut := StrGet(&sTemp, nSize, "CP0") ; or even providing an empty string, ...
by fade2gray
11 Dec 2020, 11:34
Forum: Ask For Help
Topic: Hide command console when using RunWaitOne() example Topic is solved
Replies: 18
Views: 313

Re: Hide command console when using RunWaitOne() example Topic is solved

You can just save what CmdRet() returns in a variable. Yes I understand, but I found the function still serves my purpose when removing the optional parameters and replacing ( callBackFuncObj && callBackFuncObj.Call(stdOut) ) with ( "" && "".Call(stdOut) ) So, not fully understanding exactly what t...
by fade2gray
11 Dec 2020, 09:38
Forum: Ask For Help
Topic: Hide command console when using RunWaitOne() example Topic is solved
Replies: 18
Views: 313

Re: Hide command console when using RunWaitOne() example Topic is solved

BoBo Including DllCall("AllocConsole") and WinHide % "ahk_id " DllCall("GetConsoleWindow", "ptr") in the function, greatly reduces the duration the console is displayed but doesn't fully hide it. teadrinker While this does hide he console, I don't need the content of sOutput to be displayed in a me...

Go to advanced search