Jump to content

Do until loop not exiting... I think I know which part of the code it is, I'm just not sure why...


Recommended Posts

Posted

It's right at the bottom, I'm sure of that. 
Would someone mind taking a look??
Thanks for your time!


 

While 1 ;Start of runtime loop...

Do ;Do the following...
$string = ClipGet() ;Record Clipboard to Variable.
$isin = StringInStr( $string, "txt:") ;Check Text in the Variable to see if it contains the word "Magnet:"
Sleep( 2000 ) ;Do nothing for 2 seconds.
Until $isin = 1 ;...until the text in the clipboard contains the word "magnet:".

MsgBox( 0, "URL", $string) ;Tell us what's in the clipboard in a messagebox.
$string2 = $string ;Copy String verable to string2 to compaire it later.

;Testing to see if our clipboard text is new or old.
Do; Do the following...
$string = ClipGet() ;Copy the text in the clipboard to a varable.
Sleep( 2000 ) ;Do nothing for 2 seconds.
Until Not $string == $string2 ;...until string no longer equals the same thing.

WEnd ;End of runtime loop.



Again, I'm pretty sure it's this. I've tried with one and two equals signs (A habit from LUA)

 

Until Not $string == $string2 ;...until string no longer equals the same thing.

 

  Reveal hidden contents
 
Posted
Do ;Do the following...
    $string = ClipGet() ;Record Clipboard to Variable.
    $isin = StringInStr( $string, "txt:") ;Check Text in the Variable to see if it contains the word "Magnet:"
    Sleep( 2000 ) ;Do nothing for 2 seconds.
Until $isin = 1 ;...until the text in the clipboard contains the word "magnet:".

StringInStr returns the position of substring in string. So this loop only ends when string starts with substring. Is this what you want? Because in the comments you talk about "contain". For me this means "anywhere in string".

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

Your second loop seems to check if new data is available on the ClipBoard.
I suggest to use _ClipBoard_GetSequenceNumber for this task.

My UDFs and Tutorials:

  Reveal hidden contents

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...