Sorry for the unhelpful title but it's not easy to describe this problem in 8 words.
This little part of my script is trying to identify two separate paragraphs within a string by the gap between them,
then store them in two variables called a and b.
Code: Select all
+x:: {
KeyWait("x"), KeyWait("LShift"), sound_pop()
z:="
(
1
2
3
4
5
6
)"
a:=Trim(SubStr(z, 1, InStr(z,"`n`n")),"`n") ; 1st paragraph (start at start, end at double carriage return)
b:=Trim(SubStr(z, InStr(z,"`n`n") ),"`n") ; 2nd paragraph (start at double carriage return, end at end)
MsgBox(a b)
}
Code: Select all
1
2
34
5
6
highlight it, copy it to clipboard, and store the clipboard contents in z,
testing it again “in the field”, as it were, the message box suddenly returns blank/empty/nothing.
I suspect it has something to do with the carriage returns, but I don't know.
Something small and stupid on my part no doubt.
Can someone point me in the right direction?
Thanks!