READ reads a line from STDIN
GENERAL-IO
READ
N.A.
/LINE - takes in a line at one time. A line will be limited to 255 places.
READ reads a line from STDIN, useful as READ/LINE for CGI scripting with method POST.
text: select/case system/environment "REQUEST_METHOD"
if text = "POST" [
; Read from STDIN, this is for POST
data-in: ""
more-in: ""
text: select/case system/environment "CONTENT_LENGTH"
content-length-string: text
if not is-none text [
content-length: to whole! text
rest-length: content-length
while rest-length > 0 [
more-in: READ/LINE
data-in: join/with data-in more-in
rest-length: rest-length - 255
]
content-in: find/tail data-in "="
]
]
; For input from STDIN (user input)
data-in: TO STRING! READ/LINE