<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>
In Local Variable Words in Local Variables Library
Ends the declaration of a list of local variables.
: TEST ( age -- age+10 ) LOCALS{ age } \ declare age a local variable SET age \ set local variable from the value on the stack 10 +SET age \ add 10 to the value stored in age age \ leave age+10 on the stack ;
A list of local variables within a colon definition is declared with LOCALS{ and ended with the word }. There must be at least one space character between the last local variable and }.
LOCALS{
}