Copy :{
; Copy the first line to the clipboard without a $crlf (in case there's only just the one line selected
; and not using the -a switch because we want to overwrite (initially) what's on the clipboard.
clipboard $sline(@TEST,1)
; Now get ready to loop through the rest of the lines, if there are any.
var %i
while ($sline(@TEST,%i)) {
; Since we've made it into the loop, we must have found another line to add. Add a $crlf
; (carriage return/line feed) to get to the next line and then the text found on the next line.
; Copy it to the clipboard, this time using the -a switch to add it to what's already there.
clipboard -a $+($crlf,$ifmatch)
; Increment %i to see if there is another line.
inc %i
}
}