<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>


MAXLEN$ Search:

In String Constant Words in String Library

Word Name: MAXLEN$
Type: Standard word
Data Stack Signature: $Caddr -- maxlen
Return Stack Signature: --
Availability: V1.2
Description:

Returns the maximum allowed string length for the specified string constant.

Example:

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)

Comment:

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.

See Also: $CONST  :=''  CLEN$ 

<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>