如何获得堆栈列表卡? - livecode

时间:2014-05-09 04:11:56

标签: livecode

我希望获取列表卡并按名称列出堆栈对象。

之前。我问问题“如何找到项目浏览器的堆栈? - livecode”。我可以做到。

现在。我希望获得列表卡并按名称列出堆栈对象。

有人可以为我展示示例代码吗?

这是我获取此堆栈卡数的代码

answer the number of cards of this stack

但我的代码这个错误获取名片

answer the name of cards of this stack

-------我可以解决这个问题-------

on mouseUp
   put the number of cards of this stack into numC
   repeat with crd = 1 to the number of cards of this stack
      answer the name of card crd
   end repeat
end mouseUp

1 个答案:

答案 0 :(得分:1)

这是一个创建一个堆栈卡名称作为键的数组的示例。每个数组元素都包含卡片控件的列表。

on mouseUp
   local tCurrentStack, tCards, tCurrentCard, tControlsA

   put "MyStack" into tCurrentStack
   put the cardNames of stack tCurrentStack into tCards
   repeat with tCardIndex = 1 to the number of lines in tCards
      put line tCardIndex of tCards into tCurrentCard
      repeat with tControlIndex = 1 to the number of controls in card tCurrentCard of stack tCurrentStack
         put the name of control tControlIndex of card tCurrentCard of stack tCurrentStack & LF after tControlsA[tCurrentCard]
      end repeat
   end repeat
end mouseUp

显示卡片“MyCard”的控件......

put tControlsA["MyCard"]