开发者

TCL How to have as a class member an array (Itcl)

开发者 https://www.devze.com 2023-03-16 16:17 出处:网络
I want to have an array as a private class member. I use Itcl package. For lists and other 开发者_开发知识库simple variables I was writing:

I want to have an array as a private class member. I use Itcl package.

For lists and other 开发者_开发知识库simple variables I was writing:

itcl::class MyClass {
private variable m_myVar ""
private variable m_myListVar {}
..........

Now what I can do for array member?


I think you should declare the variable as normal using private variable m_myArray and then in the constructor initialize it as an array array set m_myArray {}

0

精彩评论

暂无评论...
验证码 换一张
取 消