如何限制弹出窗口中的项目?

时间:2015-04-21 10:48:46

标签: livecode

如何限制弹出窗口中的项目。 “Sar”数组包含很多单词,就选择而言。如果我的第一个弹出窗口包含15个项目并进行了更改。当进入下一个弹出窗口时,如果它包含10个项目,则第一个中的剩余5个项目也会添加到第二个弹出选项中。 如何在弹出菜单项中杀死该缓冲区?我使用这段代码

    global jar,myjar,sam,mySam,Dic,Sar
on mouseUp pMouseButton
   put the selectedText of field "MytextField" into Ftext

   if pMouseButton = 3 then

      put the number of lines of (the keys of sam) into mySam
      repeat with i = 1 to mySam 
         if sam[i] contains Ftext then
            put sam[i] into Sar
            split Sar by comma
         end if
      end repeat

      put the text of button "M" into tText
      put the number of words of (the keys of Sar) into mylength
      repeat with x = 1 to mylength 
         put Sar[x] into line x of tText
         end repeat
      put mylength into kk---now iam using this code for delete the buffer
      ----repeat with j = kk to 100
         ---put "" into line j of tText
      ---end repeat
      set the text of button "M" to tText
      popup button "M" at the clickLoc 
   else
      --popup button "M" at the clickLoc
      -- do other stuff here
   end if
end mouseUp

是否有限制弹出窗口中的项目的选项。示例: - 如果弹出窗口包含15个项目,我只想看到10个项目,其余5个项目只能看到弹出窗口中的底部按钮

1 个答案:

答案 0 :(得分:0)

您使用的globals可能不是您想要的。

尝试在添加一些新值之前使用put empty into Sar清空全局,或者使用locals在代码完成后清空它们。