如何获取堆栈列表卡? - 实时代码

问题描述 投票:0回答:2

我想获取列表卡并按名称列出堆栈中的对象。

之前。我问问题“如何找到项目浏览器堆栈? - 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
livecode
2个回答
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"]

0
投票

获取{group | 的cardNames堆栈}

© www.soinside.com 2019 - 2024. All rights reserved.