mmikeww / AHK-v2-script-converter

AHK v1 -> v2 script converter
https://autohotkey.com/boards/viewtopic.php?f=6&t=25100
The Unlicense
580 stars 44 forks source link

Blank/Empty output or some code is missing from output #277

Closed andymbody closed 3 months ago

andymbody commented 3 months ago

V1:

#Requires AutoHotkey v1.1.35+
#SingleInstance Force

esc::ExitApp
F11::
F12::
    MouseGetPos, mX, mY
    ((A_ThisHotkey="F11") ? announce("x := " mx) : announce("y := " my))
    return

announce(msg) {
    tooltip % msg
    return
}

V2 (Converted):

#Requires Autohotkey v2.0
#SingleInstance Force

esc::ExitApp()
F11::
F12::
{ ; V1toV2: Added bracket
global ; V1toV2: Made function global
    MouseGetPos(&mX, &mY)
} ; V1toV2: Added bracket in the end

V2 (Expected):

#Requires Autohotkey v2.0
#SingleInstance Force

esc::ExitApp()
F11::
F12::
{ ; V1toV2: Added bracket
global ; V1toV2: Made function global
    MouseGetPos(&mX, &mY)
    ((A_ThisHotkey="F11") ? announce("x := " mx) : announce("y := " my))
    return
} ; V1toV2: Added bracket before function

announce(msg) {
    ToolTip(msg)
    return
}

Converted code is completely empty/missing or some code is missing from original. I have fixed this and will submit a pull-request.