Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: setting values to blocks - need help

From: tim-johnsons::web::com at: 28-Apr-2009 14:56

On Tuesday 28 April 2009, Tim Johnson wrote:
> And that is not a bad thing, once you get used to it. For instance, if > you were to assign a series value to a word in a function, rather than > 'copy'ing the value to the word, the word then retains its value, for > subsequent calls to that function. Like a static datatype in C. > Can be useful at times.
Sorry - left out an example. Example below: test: func[/local res][ count: [0] count/1: count/1 + 1 print rejoin["this function has been called " count/1 " times"] ]
>> loop 6[test]
this function has been called 1 times this function has been called 2 times this function has been called 3 times this function has been called 4 times this function has been called 5 times this function has been called 6 times ;; HTH tim