Use the COPY-LOB statement to copy the full content of the text file to a LONGCHAR variable, for example:
DEFINE VARIABLE lc AS LONGCHAR NO-UNDO.
DEFINE VARIABLE c AS CHARACTER NO-UNDO.
COPY-LOB FILE "TextFileWithOneLineAndNoCarriageReturn.txt" TO lc.
c = lc. /* assuming lc is less than 32k */
VIEW-AS ALERT-BOX INFO BUTTONS OK.
If a pseudo-file / OS device is specified, other approaches may be required. As specific examples:
1. On Windows, INPUT FROM "CLIPBOARD" will also show this behavior, but the clipboard is not a valid source for COPY-LOB.
Instead, assign the clipboard value to the longchar using the CLIPBOARD system handle: lc = CLIPBOARD:VALUE.
2. If reading from a dedicated input device such as a Barcode Reader, the devices themselves can usually be configured to send a carriage return / linebreak after the last data.