Jump to content

The problem with the correct operation of ClipGet()


AndreyS
 Share

Recommended Posts

Developers, can anyone explain this phenomenon to me?
Run this code and wait for nothing without doing a few minutes and you will start receiving randomly, either one or the second message. But none of them should never appear on the logic of the code!
As I understand sometimes the function ClipGet () returns an empty value. Why is this happening?

Dim $ClipGetText

ClipPut("12345")

While 1
    Sleep(5) ;reduced to 5 to better see the problem
    if ClipGet()<>$ClipGetText And ClipGet()<>"" Then
            $ClipGetText=ClipGet()
            Beep(800,100)
            ConsoleWrite(ClipGet()&"|"&$ClipGetText&@CRLF)
    ElseIf ClipGet()="" Then
        Beep(800,100)
        ConsoleWrite("Empty"&@CRLF)
    EndIf
WEnd

 

Link to comment
Share on other sites

  • Moderators

I let it run for 10 minutes and saw nothing beyond the initial

Quote

12345|12345

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

AndreyS,

Same result here.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

I am still running it and it's been 25 minutes and the only time it shows empty is occasionally when I copy something new to the clipboard. Other than that it's being completely quiet.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Why does your output keep showing the 12345|12345?

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

No no - you do not need to copy anything while doing this.

"only time it shows empty"
And yet you have received this message at least once! And it should not have been one!


I do not know why the rest do not get such problems. Maybe it depends on the power of the computer.

Link to comment
Share on other sites

Your script as written above should never produce this output.

Quote

12345 | 12345
12345 | 12345
12345 | 12345
12345 | 12345
12345 | 12345
12345 | 12345
12345 | 12345
Empty
12345 | 12345

As to my results showing empty, as I stated, it only shows the empty line when I copy new information to the clipboard.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

I still thought that! Maybe some third-party program affects the clipboard somehow ?! I'll try to close all programs as much as possible and see if there is any dependence!

Yes, yes, based on the code, there should not be a single message other than the first.

Edited by AndreyS
Link to comment
Share on other sites

I seem to have caught the dependence on one of my programs.
In it there is such line:
If ClipGet() <> $TextForClipb And StringInStr(ClipGet(), ":") > 0 And Number(StringMid(ClipGet(), StringInStr(ClipGet(), ":") + 1, 1)) > 0 And StringLen(ClipGet()) < 40 Then ...

Tell me, can it affect the contents of the clipboard? And because of this, I get that output messages that should not be displayed?

Link to comment
Share on other sites

  • Moderators

Is this what you've been doing? Why didn't you explain this in the beginning? The last two posts are completely different than your first; we can't help you when you're not giving us all the info up front.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

JLogan3o13 you do not correctly understand me apparently. You need to run two scripts! Compile the last and run. And from the editor, run my first code!

The second script I just invented quickly to check how they will work in parallel. Also I understood why you do not receive messages, and I received. My second program, which was always running when developing a new program, also uses ClipGet (). So there was a conflict.

What is the problem and how to solve it now? After all, any scripts should work correctly and do not have such influence on each other.

Edited by AndreyS
Link to comment
Share on other sites

  • Developers

My guess is that this whole topic till now isn't make much sense so hence am I staying out.
I see absolutely no reason why one would want to do what you are trying to test here.
Tell us exact information on how you fill/refresh the clipboard and what it is you want to do that isn't working and you might have better luck getting answers.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

So you really do not understand anything?
I've given you two scripts that show that the ClipGet () function is buggy when it uses two different scripts at the same time!
This is absurd and so it should not be!

You still do not understand anything?

Link to comment
Share on other sites

  • Developers
Just now, AndreyS said:

This is absurd and so it should not be!

You still do not understand anything?

mmm....  Is this your polite way of asking for help, not answering any of my questions and arguing that I am stupid?  
Fuck you too!

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

So when one of the programs uses the ClipGet () function, then that gets absurd results when using ClipGet () at this time. That's what I showed you on the example of my two scripts.

I showed you this in examples and in different ways and tried to answer all your questions! If on some did not answer then I did not understand them! I'm not special, like you, in English!

Jos, I did not insult you in the least way since you insulted me now! I'm talking only about the error in language and function. And you insulted me!

Thank you for such help: send me away. From whom from whom but from you I did not expect this and had a different opinion.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...