clipboard can not be cleared - strange behavior Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
DanRim
Posts: 153
Joined: 20 Jul 2018, 15:16

clipboard can not be cleared - strange behavior

Post by DanRim » 26 Jan 2022, 15:29

Hello,

Not sure where is the problem, but in this code every time I run code clipboard should be cleared and new values displayed, but it does not work. If I run code twice old clipboard values have been adding to new values.

1) Click Ctrl + u
2) Click Enter
3) Click Ctrl + u

Or maybe on your pc works find just on my something wrong.
I tried some combinations how to clear clipboard. One of them should definitely worked.

I can clear clipboard with Reload in the end of the code, but it is not right way.

Code: Select all

#SingleInstance, Force
SetKeyDelay, -1

^u::
clipboard := ""
clipboard =
var := clipboard
var := ""
clipboard := var

Loop 10 
{
	Random, caseId, 7810000, 7819000
	caseIdData .= caseId . "`n"
}

MsgBox, % caseIdData
clipboard := caseIdData

;Reload

return
Attachments
error clipboard.JPG
error clipboard.JPG (44.01 KiB) Viewed 471 times

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: clipboard can not be cleared - strange behavior

Post by swagfag » 26 Jan 2022, 15:56

ure constantly appending to the variable caseIDdata without ever clearing it

DanRim
Posts: 153
Joined: 20 Jul 2018, 15:16

Re: clipboard can not be cleared - strange behavior

Post by DanRim » 26 Jan 2022, 16:08

@swagfag I tried place clipboard := "" in every section, before loop,in loop, after loop, does not work :) Not sure how to stop appending.

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: clipboard can not be cleared - strange behavior  Topic is solved

Post by swagfag » 26 Jan 2022, 16:30

caseIdData, not clipboard

DanRim
Posts: 153
Joined: 20 Jul 2018, 15:16

Re: clipboard can not be cleared - strange behavior

Post by DanRim » 26 Jan 2022, 16:31

@swagfag Thank you :)

Post Reply

Return to “Ask for Help (v1)”