<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>
In Programming and Stack Management Words in 32-bit library
Declares and stores a double-precision constant value (a value that does not change).
1234567. 2CONSTANT AREA AREA D. (displays 1234567)
1234567. 2CONSTANT AREA
AREA D.
The above example places the double-precision value 1,234,567 on the stack then calls 2CONSTANT. 2CONSTANT creates a constant in the dictionary with the name AREA and stores the value 1,234,567 into it.
2CONSTANT
The constant is subsequently referenced by simply referring to its name, leaving its value on the stack rather than its address.
None.