Search found 33 matches

by ZhuangQu
12 May 2024, 08:32
Forum: Wish List
Topic: add FileWrite function in alpha version
Replies: 9
Views: 1005

Re: add FileWrite function in alpha version

It can be done with a simple one-liner. Why should the interpreter and documentation be inflated with these small but completely redundant functions? For matters of convenience, there are solutions that don't involve adding more redundant built-in functions, or waiting for someone else to do it for...
by ZhuangQu
07 May 2024, 09:32
Forum: Wish List
Topic: add FileWrite function in alpha version
Replies: 9
Views: 1005

Re: add FileWrite function in alpha version

lexikos wrote:
07 May 2024, 06:58

Code: Select all

FileOpen(path, "w").Write(text)
Thank you for your simple solution!
However, I advocate FileWrite for semantic consistency
- where there is FileRead and FileAppend, there should be FileWrite.
These three represent the basic operations we do with files.
It is not complete without any one.
by ZhuangQu
07 May 2024, 01:07
Forum: Wish List
Topic: add FileWrite function in alpha version
Replies: 9
Views: 1005

add FileWrite function in alpha version

In other languages, it's easy to write text to a file. But in AutoHotkey, there's no direct way. We have to write such functions by hand: FileWrite(text, path) { if FileExist(path) FileDelete(path) FileAppend(text, path) } AutoHotkey already has FileRead and FileAppend functions, and should have Fil...
by ZhuangQu
15 Apr 2024, 15:54
Forum: Bug Reports
Topic: ":: try {throw}" still throws an error Topic is solved
Replies: 5
Views: 459

Re: ":: try {throw}" still throws an error Topic is solved

You're right, but my code is still compilable and executable.
And at first glance, nothing seems wrong.
Should we report a syntax error?
by ZhuangQu
15 Apr 2024, 15:50
Forum: Bug Reports
Topic: Click should return "" just like MouseClick Topic is solved
Replies: 13
Views: 578

Re: Click should return "" just like MouseClick Topic is solved

Thank you for your insightful discussion! I understand.
by ZhuangQu
14 Apr 2024, 11:11
Forum: Bug Reports
Topic: Click should return "" just like MouseClick Topic is solved
Replies: 13
Views: 578

Re: Click should return "" just like MouseClick Topic is solved

I argue that Click() returns 5369740240 is a bug because of the documentation: If the flow of execution within a function reaches the function's closing brace prior to encountering a Return, the function ends and returns a blank value (empty string) to its caller. A blank value is also returned when...
by ZhuangQu
14 Apr 2024, 07:08
Forum: Bug Reports
Topic: Click should return "" just like MouseClick Topic is solved
Replies: 13
Views: 578

Re: Click should return "" just like MouseClick Topic is solved

I have tested many functions that don't have an return value in the documentation. They all return "", only Click is an magic number.
by ZhuangQu
14 Apr 2024, 06:54
Forum: Bug Reports
Topic: ":: try {throw}" still throws an error Topic is solved
Replies: 5
Views: 459

Re: ":: try {throw}" still throws an error Topic is solved

A similar problem is

Code: Select all

MButton:: loop 3 {
    MsgBox(A_Index)
}
does not work as expected. It shows 0 once.
My version is v2.0.12.
by ZhuangQu
14 Apr 2024, 06:38
Forum: Bug Reports
Topic: Click should return "" just like MouseClick Topic is solved
Replies: 13
Views: 578

Click should return "" just like MouseClick Topic is solved

Code: Select all

MsgBox(Click())
MsgBox(MouseClick())
In the document of Click (https://www.autohotkey.com/docs/v2/lib/Click.htm), there is no return value mentioned.
So Click should return empty string just like MouseClick, not a magic number 5369740240.
by ZhuangQu
14 Apr 2024, 00:48
Forum: Bug Reports
Topic: ":: try {throw}" still throws an error Topic is solved
Replies: 5
Views: 459

":: try {throw}" still throws an error Topic is solved

Code: Select all

MButton:: try {
    throw
}
When we press MButton, it still throws an error unexpectedly.
For comparison, the following code are OK:

Code: Select all

MButton:: try throw
by ZhuangQu
10 Apr 2024, 07:02
Forum: Bug Reports
Topic: A_Screen{Width,Height,DPI} are wrong when changing the main monitor Topic is solved
Replies: 6
Views: 563

Re: A_Screen{Width,Height,DPI} are wrong when changing the main monitor Topic is solved

just me wrote:
09 Apr 2024, 15:36
A_ScreenDPI
In a system with multiple display monitors, this value is the same for all monitors.
?
That's not a contradiction. A_ScreenDPI is the same for all monitors indeed.
My issue is that A_ScreenDPI should be updated when changing main monitor.
by ZhuangQu
09 Apr 2024, 03:42
Forum: Bug Reports
Topic: an issue on "~!= Up::Ctrl" Topic is solved
Replies: 3
Views: 302

Re: an issue on "~!= Up::Ctrl" Topic is solved

My version is 2.0.12.
by ZhuangQu
07 Apr 2024, 11:51
Forum: Bug Reports
Topic: A_Screen{Width,Height,DPI} are wrong when changing the main monitor Topic is solved
Replies: 6
Views: 563

Re: A_Screen{Width,Height,DPI} are wrong when changing the main monitor Topic is solved

The key to reproduce this bug are the different zooms. If both are 200%, everything is OK.
by ZhuangQu
07 Apr 2024, 11:45
Forum: Bug Reports
Topic: A_Screen{Width,Height,DPI} are wrong when changing the main monitor Topic is solved
Replies: 6
Views: 563

A_Screen{Width,Height,DPI} are wrong when changing the main monitor Topic is solved

The code for reproducibility is ~LButton:: ToolTip(A_ScreenWidth "," A_ScreenHeight "," A_ScreenDPI) I have two monitors. For monitor 1, the size is 2560×1600 and the zoom is 200%. For monitor 2, the size is 3840×2160 and the zoom is 175%. First, I set monitor 1 as the main monitor and start the scr...
by ZhuangQu
06 Apr 2024, 13:02
Forum: Bug Reports
Topic: an issue on "~!= Up::Ctrl" Topic is solved
Replies: 3
Views: 302

an issue on "~!= Up::Ctrl" Topic is solved

when run ~!= Up::Ctrl the key history is A4 038 d 2.31 LAlt BB 00D d 0.14 = BB 00D h u 0.05 = 11 01D i u 0.00 Control A4 038 u 0.03 LAlt where the Control only be up and never be down. when run #HotIf 1 == 1 ~!= Up::Ctrl the key history is A4 038 d 1.84 LAlt BB 00D d 0.36 = BB 00D h u 0.06 = 11 01D ...
by ZhuangQu
15 Mar 2024, 06:59
Forum: Bug Reports
Topic: not work when !]:: Send("^{Insert}a") Topic is solved
Replies: 8
Views: 550

Re: not work when !]:: Send("^{Insert}a") Topic is solved

Alt and AltGr are not the same thing. AltGr is always on the right. What keyboard layout are you using? I'm in China and I use US keyboard layout, so I don't have the AltGr key. When executing !]:: Send("^{Insert}a") my AutoHotkey history is A5 138 d 3.50 RAlt DD 01B d 0.31 ] A2 01D i d 0.00 LContr...
by ZhuangQu
14 Mar 2024, 02:30
Forum: Bug Reports
Topic: not work when !]:: Send("^{Insert}a") Topic is solved
Replies: 8
Views: 550

Re: not work when !]:: Send("^{Insert}a") Topic is solved

I am dubious. The hotkey !]:: would not execute if you held AltGr, because the system treats AltGr as Alt+Ctrl. Pressing AltGr+] would have the same effect as without the script, which is not to select all. On the US International layout, it is to produce » . Even !»:: doesn't execute if I press Al...

Go to advanced search