<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>
In Compilation Words in TurboForth Kernal
Defines a VALUE using the name immediately following in the terminal input buffer with the value n.
VALUE
10 VALUE TEN : TEST ( -- ) TEN . ; TEN
(displays 10)
At run time, when the name of the VALUE is encountered, its value shall be pushed to the stack.
VALUEs when created expect their initial value to be on the stack.
Use TO and +TO to modify the value. VALUEs should not be defined within a colon definition.
TO
+TO
To reference the value in code, simply refer to it by name.