For ways of storing character strings in memory see String representations.
Words for inputting one line from the keyboard:
Get a string of up to n1 characters from the user input
device and store it at c-addr. n2 is the length of
the received string. The user indicates the end by pressing
RET. Gforth supports all the editing functions available
on the Forth command line (including history and word
completion) in accept.
edit the string with length n2 in the buffer c-addr
n1, like accept.
Obsolete words:
Receive a string of at most +n characters, and store it
in memory starting at c-addr. The string is
displayed. Input terminates when the <return> key is pressed or
+n characters have been received. The normal Gforth line
editing capabilites are available. The length of the string is
stored in span; it does not include the <return>
character. OBSOLETE: This word has been de-standardized in
Forth-2012. Use accept instead.
The variable at addr contains
the length of the last string received by expect. OBSOLETE:
This word has been de-standardized in Forth-2012. Use
accept instead.