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


VALUE Search:

In Compilation Words in TurboForth Kernal

Word Name: VALUE
Type: Immediate compiling word
Data Stack Signature: n --
Return Stack Signature: --
Availability: V1.0  V1.1  V1.2
Description:

Defines a VALUE using the name immediately following in the terminal input buffer with the value n.

Example:

10 VALUE TEN
: TEST ( -- ) TEN . ;
TEN

(displays 10)
 

Comment:

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 reference the value in code, simply refer to it by name.

See Also: +TO  TO 

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