[REBOL] Context misery
From: sanghabum:aol at: 5-Jun-2001 7:13
Hi there,
Could someone with a better grasp of context than me explain why this won't
work?---I think the problem is using a local variable in a DO:
myfunc: func [BlockName [string!]
/local aa bb][
aa: copy [1 2 3]
bb: join BlockName ": copy aa"
print ["aa is " mold aa]
print ["bb is " mold bb]
do bb
]
When I run it I get:
>> myfunc "myblock"
aa is [1 2 3]
bb is "myblock: copy aa"
** Script Error: aa has no value
** Where: myfunc
** Near: myblock: copy aa
>>
All I'm trying to do is create a variable dunamically based on a name passed
to a function.
Thanks!
Colin.