Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issues clearing the _Clipboard
#1
I cannot clear the clipboard.  I have tried:

_Clipboard$ = ""

The clipboard stays the same.  Thinking that the code behind this command might be a tad picky I tried:

a$ = ""
_Clipboard$ = a$

Nope again...clipboard is still the same.

Is this a bug?  I am using version 3.14.0, but I did not see this in the change log for 3.14.1 so I did not try it there.

The following prints "ON THE CLIPBOARD" both times:

Code: (Select All)
a$ = "ON THE CLIPBOARD"
_Clipboard$ = a$
Print _Clipboard$
_Clipboard$ = ""
Print _Clipboard$


The out put is:
ON THE CLIPBOARD
ON THE CLIPBOARD


hmmm...
Reply
#2
Code: (Select All)
a$ = "ON THE CLIPBOARD"
_Clipboard$ = a$
Print _Clipboard$
_Clipboard$ = " "
Print _Trim$(_Clipboard$)

I think the best you can probably do is to set it to a single space. Trying to pass a null string "" doesn't work to clear the clipboard for us. If at all possible, just pass a blank space and then trim it out of any response you recieve, like with the above.
Reply
#3
(09-21-2024, 09:37 PM)SMcNeill Wrote: I think the best you can probably do is to set it to a single space.  Trying to pass a null string "" doesn't work to clear the clipboard for us.    If at all possible, just pass a blank space and then trim it out of any response you recieve, like with the above.

Thank you Steve...
Reply
#4
The empty quotes look as if they are not recognised as a string! Replace these with the null character Chr$(0)
Alternatively, append the null terminator to the quotes, e.g., _Clipboard$ = "" + Chr$(0)
Reply
#5
Thank you mpgcan, that worked!

I swear that I used to assign the clipboard to a null string in the past and it worked.  I was ALMOST sure of it...but that was not good enough for me.

Being a person that cannot leave my memory to 'well I thought, but I guess not' I set out on a journey and I had to get my answer.  Soooo I dug up old versions of the compiler that I have and tried it.  I used the following program:

Code: (Select All)

_Clipboard$ = "it did not work"
_Clipboard$ = ""
a$ = _Clipboard$
If a$ = "" Then Print "IT WORKED!" Else Print a$


qb64.exe v1.5 worked

qb64pe.exe v3.0.0 worked
qb64pe.exe v3.4.0 worked
qb64pe.exe v3.11.0 worked

qb64pe.exe v3.13.1  Did not work

HA!  So my memory is correct and I'm not second guessing myself (or am I...?).  Somewhere between v3.11.0 and v3.13.1 this bug was introduced...err...feature was added.
Reply
#6
(09-22-2024, 11:29 AM)dano Wrote: qb64.exe v1.5 worked

qb64pe.exe v3.0.0 worked
qb64pe.exe v3.4.0 worked
qb64pe.exe v3.11.0 worked

qb64pe.exe v3.13.1  Did not work

HA!  So my memory is correct and I'm not second guessing myself (or am I...?).  Somewhere between v3.11.0 and v3.13.1 this bug was introduced...err...feature was added.
Thank you for checking and reporting.  Heart

We did update the clipboard code to get _CLIPBOARDIMAGE working on all platforms. So, this changed then.

I've opened a GitHub issue. This will be fixed in the next version.
Reply
#7
Glad I read errata bugs.  Bitten by the same _clipboard bug.  If it was not for the fact I re-compile everything on the next qb64pe.  I would have never known until I wrote a new program using _Clipboard="".  Old compiled EXE would not contain the problem code.  Hence never see it.

Thanks for the temporary solution until next release.
Reply




Users browsing this thread: 11 Guest(s)