<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>
In String Constant Words in String Library
Assigns the string following the word to the referenced string constant.
50 $CONST WELCOME \ define a string constant called WELCOME WELCOME :=" Hello, World!" \ assign the string Hello, World! to WELCOME WELCOME .$CONST \ display it
50 $CONST WELCOME
WELCOME :=" Hello, World!"
WELCOME .$CONST
The string should be terminated with a quotation mark.
An error occurs if the string to be assigned will not fit within the space allocated to the string constant when it was declared.
For example:
5 $CONST COLOUR COLOUR :=" Purple" \ does not fit. An error occurs.