More parsing difficulties.
In SQL Server, one can copy to the clipboard the results of a query, and those results seem to be lines delimited by the carriage-return-line-feed characters (0D0A), but they are in the clipboard as one big string. So I want to divide them up on the CR-LF into a block of lines so I can do stuff with them. I seem to be unable to format that parse function call correctly and wonder if anyone can straighten me out. Here is what I have tried so far without success: Thank you.
R E B O L [
Title: "Clipboard lines"
Purpose: {Read from the clipboard a string of lines delimited by
cr-lf, and return a block of those lines suitable for examination
on a line-by-line basis.}
]
CLIPBOARD-LINES: func [
/local CLIPSTRING LINEBLOCK
] [
LINEBLOCK: copy []
CLIPSTRING: copy ""
CLIPSTRING: read clipboard://
;;;;LINEBLOCK: parse/all CLIPSTRING #"(0D0A)"
;;;;LINEBLOCK: parse/all CLIPSTRING #(0D0A)
;;;;LINEBLOCK: parse/all CLIPSTRING to-string #"(0D0A)"
;;;;LINEBLOCK: parse/all CLIPSTRING to-string #(0D0A)
;;;;LINEBLOCK: parse/all CLIPSTRING newline
;;; LINEBLOCK: parse/all CLIPSTRING rejoin [#(0D) #(0A)]
return LINEBLOCK
]
;;Uncomment to test
CLIPPEDLINES: CLIPBOARD-LINES
print [length? CLIPBEDLINES " lines"]
halt