From: InetDavid on
I'd like to use an Array as a TclOO variable for internal storage.
The object would never pass the Array itself outside the object.
Instead, I'll have access methods for accessing the Array. Is there a
way to have an Array in a TclOO object? If so, how would you specify
it, initialize it and use it in a method?

Thank you!

David Schmidt
dschmidt(a)ciena.com
From: George Petasis on
στις 6/4/2010 12:38 πμ, O/H InetDavid έγραψε:
> I'd like to use an Array as a TclOO variable for internal storage.
> The object would never pass the Array itself outside the object.
> Instead, I'll have access methods for accessing the Array. Is there a
> way to have an Array in a TclOO object? If so, how would you specify
> it, initialize it and use it in a method?
>
> Thank you!
>
> David Schmidt
> dschmidt(a)ciena.com

Like any other variable:

consructor {args} {
my variable array_var
set array_var(x) 1
}

method some_method {} {
my variable array_var
parray array_var
}

George