ClipWait fails with A_Clipboard in v1 Topic is solved

Report problems with documented functionality
User avatar
mikeyww
Posts: 28871
Joined: 09 Sep 2014, 18:38

ClipWait fails with A_Clipboard in v1

19 Jan 2024, 08:04

Code: Select all

#Requires AutoHotkey v1.1.35

Clipboard := ""       ; Use Clipboard
Clipboard := 1 + 2
ClipWait 1
MsgBox % ErrorLevel

A_Clipboard := ""     ; Use A_Clipboard
A_Clipboard := 1 + 2
ClipWait 1
MsgBox % ErrorLevel
The second ClipWait generates an error.

AHK v1.1.37.01 on Win 11 Pro.
[v1.1.35+]: A_Clipboard is an alias of Clipboard.
lexikos
Posts: 9780
Joined: 30 Sep 2013, 04:07
Contact:

Re: ClipWait fails with A_Clipboard in v1

19 Jan 2024, 20:46

The clipboard variable(s) are incompatible with the binary number cache. Caching is disabled for "Clipboard" but not "A_Clipboard". Assigning a string instead of a binary number will work.
User avatar
mikeyww
Posts: 28871
Joined: 09 Sep 2014, 18:38

Re: ClipWait fails with A_Clipboard in v1

19 Jan 2024, 21:27

OK. Aside from Clipboard, a solution for others is below, in case needed.

Code: Select all

#Requires AutoHotkey v1.1.35

A_Clipboard := "" ; Use A_Clipboard
A_Clipboard := Format("{}", 1 + 2)
ClipWait 1
MsgBox % ErrorLevel "`n" A_Clipboard

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 32 guests