String Constants

16 views
Skip to first unread message

Craig Lindley

unread,
Sep 19, 2018, 9:04:49 AM9/19/18
to pforthdev
how does one define a string constant in pForth?

c" string constant" constant NAME

won't work because the storage used by c" can be reused at any time which would make NAME point at the latest use of c" and possibly not the original string.


Helmut Eller

unread,
Sep 19, 2018, 9:16:48 AM9/19/18
to Craig Lindley, pforthdev
: NAME c" string" ;

should work. However these days S" is recommended over C".

Helmut
Reply all
Reply to author
Forward
0 new messages