Trouble with a funtion when named "Scale" or "vk1234"
Posted: 15 Aug 2017, 13:48
Hi all,
I have trouble when I want to name a function "Scale".
Here is an example with a function named "xScale" and it works as intended.
When I rename the function to "Scale" as I desire (yes, I renamed all 3 occurrences of its name), the function does not work any more.
Can anybody confirm, please? Better yet, can anybody explain please why this is?
I also have trouble with "vk1234" as a function name, which lets me think there might be some interference with scan code and/or virtual key code.
To clarify: I have no desire to name a function "vk1234", but I did test my "scan code" theory.
https://autohotkey.com/docs/Variables.htm explains about variable names.
I can't find a help topic about function names. I have assumed up til now that both are treated as "idioms" (if that is the correct term?), whose rules are explained in the docs.
I am obviously wrong about that too.
Thanks for reading!
Edit: I will likely change the function name to "Zoom()", but I still want to learn about this problem.
I have trouble when I want to name a function "Scale".
Here is an example with a function named "xScale" and it works as intended.
When I rename the function to "Scale" as I desire (yes, I renamed all 3 occurrences of its name), the function does not work any more.
Code: Select all
#NoEnv
#SingleInstance, Force
SetBatchLines, -1
Gui, Clock: New, HWNDhClock -Caption, Clock
Gui, +0x00400000 ; WS_DLGFRAME (3D border)
Gui, Margin, 5, 5
Gui, Add, Text, w300 h300 Border
Gui, Show
Return ; end of auto-execute section
ClockGuiClose:
ClockGuiEscape:
ExitApp
;-------------------------------------------------------------------------------
#If WinActive("ahk_id " hClock) ; hotkeys for GUI
;-------------------------------------------------------------------------------
^WheelUp:: xScale("Up")
^WheelDown:: xScale("Down")
#If ; off
;-------------------------------------------------------------------------------
xScale(d) { ; trouble with this funtion when named "Scale" or "vk1234"
;-------------------------------------------------------------------------------
ToolTip, %d%, 50, 50
}
;-------------------------------------------------------------------------------
WM_LBUTTONDOWN() { ; move window
;-------------------------------------------------------------------------------
static init := OnMessage(0x0201, "WM_LBUTTONDOWN")
PostMessage, 0xA1, 2 ; WM_NCLBUTTONDOWN
}
I also have trouble with "vk1234" as a function name, which lets me think there might be some interference with scan code and/or virtual key code.
To clarify: I have no desire to name a function "vk1234", but I did test my "scan code" theory.
https://autohotkey.com/docs/Variables.htm explains about variable names.
I can't find a help topic about function names. I have assumed up til now that both are treated as "idioms" (if that is the correct term?), whose rules are explained in the docs.
I am obviously wrong about that too.
Thanks for reading!
Edit: I will likely change the function name to "Zoom()", but I still want to learn about this problem.