Jump to content
Macro Express Forums

comapre clipboard with T1 ?


koden
 Share

Recommended Posts

I can't find out to do following thing:

 

I run thru a lot of server names.

I copy the server name and put it into notepad, copy next server name and put it into notepad a.s.o.

 

But I would like to make a check, so that if the server name already exist in the notepad, then the macro should stop.

Because sometimes the clipboard don't get the new server name. Don't know why...

 

I think it would be easyer to do in the macro than comparing with the notepad.

 

I would do it this way:

 

copy server name to T1 and copy the server name to notepad.

next copy I would like to compare with T1 before paste into notepad.

IF clipboard and T1 is the same, macro should stop.

If not macro should paste clipboard to notepad and change T1 to the new value.

 

Do you understand and can i do this???

Link to comment
Share on other sites

I would do it like this:

 

1. Start with a blank string

2. Get the next server name

3. Check if server name is in the string yet

4. If it isn't, then append to string and add to notepad

5. Loop to 2.

 

Because sometimes the clipboard don't get the new server name. Don't know why...
Probably need to add a delay after copying it to the clipboard.
Link to comment
Share on other sites

Thanks...and sorry that I have not informed about that i have found a solution.

 

 

LOOP:

 

I copy servername to T2

IF variable T2=T1 then the macro should stop.

else

copy server name to T1

text type T1 into notepad.

 

It works but I can se it's easier your way... i think ???

Link to comment
Share on other sites

Thanks...and sorry that I have not informed about that i have found a solution.

LOOP:

 

I copy servername to T2

IF variable T2=T1 then the macro should stop.

else

copy server name to T1

text type T1 into notepad.

 

It works but I can se it's easier your way... i think ???

 

I wouldn't have thought your method would work. Unless I've misunderstood, surely it would only compare two successive names? I thought you wanted to compare each new name with all the previous ones? Or are you saying they are all in some sort of order, and duplicates only occur together?

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

I think you have misunderstood. but what the... :-) my english is'nt the best, so no wonder why :-)

 

The problem was that I have a list with server names.

I copy one name and set it into notepad.

But sometimes the clipboard did not copy the name and the old name was in the clipboard.

 

Then there would be 2 names of the same in notepad.

 

Så what i needed was just to check that the clipboard did'nt still have the old servername. :-)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...