<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>
In String Constant Words in String Library
Returns the maximum allowed string length for the specified string constant.
50 $CONST WELCOME \ define a string constant called WELCOME, max size: 50 chars WELCOME :=" Welcome, everybody!" \ put a string in the string constant WELCOME MAXLEN$ . \ display the maximum size of string constant (50)
50 $CONST WELCOME
WELCOME :=" Welcome, everybody!"
WELCOME MAXLEN$ .
Given the address of a string constant on the data stack, returns the maximum string size that can be accomdated within the string constant.
String constants place their address on the data stack when referenced, so they can simply be referenced using their name.