|
Post by Johnc on Aug 28, 2018 21:56:21 GMT
10 | IF | CLIPBOARD | VALUE | TEXT IS | ENDMARKER | STOP
The above line worked well to check if the CLIPBOARD contains the string "ENDMARKER".
What should I put down instead of "ENDMARKER" if I need to check if the CLIPBOARD contains a NULL string or a space?
Please advise Steve. Thanks!
|
|
|
Post by Steve on Aug 29, 2018 1:23:21 GMT
For a space:
3 | IF | CLIPBOARD | VALUE | TEXT CONTAINS | | MESSAGE PROMPT | clipboard contains a space value::%clipboard% By a 'NULL' string are you referring to the clipboard being 'nothing', having no value?
|
|
|
Post by Johnc on Aug 29, 2018 16:10:19 GMT
oic, this is how to do it for a space " ". Thanks Steve! Yes, what is the character to use for nothing? ""?? Actually I need the macro to stop running when the current line in a text file it is cutting and pasting from is empty.
It now works when I put a "token word" there like "END" but I am hoping that I don't need to do that.
e.g.
The text in the notepad file: (now working)
john peter joe END
I am trying to do the same thing without using END:
john peter joe
another list here mary carol june
Hopefully the macro would stop after processing joe coz there is a blank line after joe.
Thanks!
|
|
|
Post by Steve on Aug 30, 2018 1:59:17 GMT
Have you considered using a FOR LINE IN loop:
- d:\macro\names.txt john peter joe
mary carol june
1 | FOR | EACH | LINE IN | D:\Macro\names.txt | DO 2 | IF | STRING VARIABLE | %LINE% | IS | | STOP 3 | RUN ACTION | | | | MESSAGE PROMPT | Value of the line: "%line%"::Names 4 | FOR | | | | NEXT
This macro will STOP (line 2) when it gets the blank line after joe and before mary. Line 2 checks for "" no value in the current LINE. If you take the delims out it looks like this - IF STRING VARIABLE LINE IS STOP. Notice that there is no value after the 'IS' text option.
|
|
|
Post by Johnc on Aug 30, 2018 17:08:40 GMT
Yes, I should give FOR loop a try but it might be harder to keep track of where the loop is at the moment.
|
|