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


+SET Search:

In Local Variable Words in Local Variables Library

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

Pops the top of the stack, and adds the value obtained to the current value of the local variable.

Example:

: TEST ( n1 -- n2 )
  LOCALS{ n2 }
  SET n2 \ load local variable n2 with n1 (from top of data stack)
  n2 +SET n2 \ double the value stored in n2
  n2 \ leave n2 on the stack
;

Comment:

The name of the local variable must follow the word +SET.

See Also: SET 

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