[IF]  ( fl -- )

published: 9 January 2022 / updated 24 January 2022

Lire cette page en français

 

vocabulary: forth

Begins a conditional sequence of type [IF] ... [ELSE] or [IF] ... [ELSE] ... [THEN].

If flag is 'TRUE' do nothing (and therefore execute subsequent words as normal). If flag is 'FALSE', parse and discard words from the parse area including nested instances of [IF].. [ELSE].. '[THEN]' and [IF].. [THEN] until the balancing [ELSE] or [THEN] has been parsed and discarded.

Example:

DEFINED? mclr  invert [IF] 
: mclr  ( mask addr -- ) 
    dup >r c@ swap invert and r> c! 
    ; 
[THEN] 

Legal: site web personnel sans commerce / personal site without seling