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


LOCALS{ Search:

In Local Variable Words in Local Variables Library

Word Name: LOCALS{
Type: Immediate compiling word
Data Stack Signature: --
Return Stack Signature: --
Availability: V1.2
Description:

Declares a list of local variables.

Example:

: TEST ( n1 n2 -- )
  LOCALS{ LV1 LV2 }
  SET LV2 \ take n2 (top of stack) and put in local variable LV2
  SET LV1 \ take n1 (now on top of stack) and put in local variable LV1
  ." LV1=" LV1 . CR
  ." LV2=" LV2 . CR
;

Comment:

Local variables within a colon definition are defined, by name using the word LOCALS{. Local variable names must be separated with at least one space character.

Local variable declaration is ended with the word }. There must be a space between the last local variable name and the word }.

See Also: } 

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