Script Library: 1247 scripts
 

incdec.r

REBOL [ Title: "Increment and Decrement" Date: 24-Apr-1999 File: %incdec.r Purpose: { Increment and decrement a variable by one. } library: [ level: 'intermediate platform: none type: 'tool domain: none tested-under: none support: none license: none see-also: none ] ] set '++ func ['word] [set word (get word) + 1] set '-- func ['word] [set word (get word) - 1] ;Quick test: test-inc-dec: [ num: 10 ++ num print num -- num print num print ++ num print num print -- num print num ] do test-inc-dec
halt ;; to terminate script if DO'ne from webpage