View in color | License | Download script | History | Other scripts by: carl |
30-Apr 12:36 UTC
[0.051] 10.256k
[0.051] 10.256k
incdec.rREBOL [
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 |