2015-04-24 16 views
0

如何创建查找字符串的对话框。我不知道如何在LiveCode中创建对话框,以便我使用ask命令。是否在正确的代码中创建对话框的正确方法如何创建查找字符串的对话框

global x 
    on mouseUp 
     ask "What is your name?" 
     put it into x 
     if x is empty then 
      answer"wrong input" 
     else 
      repeat for each word ass in "MytextField" 
      --repeat with each word myword in fld"MytextField" 
      if "MytextField" contains myword then 
       find x after "MytextField" 
        end if 
      end repeat 

      end if 
    end mouseUp 
    on mouseDown 

    end mouseDown 

回答

0

您处于正确的轨道上,但您的处理程序有几个语法错误。试试这个,在按钮的脚本,确保您有它的一个名为“myTextField将”有一些相关的文本字段:

on mouseUp 
ask "What is your name?" 
put it into x 
if x is empty then 
    answer "wrong input" 
else 
    repeat for each word myword in fld "MytextField" 
    if fld "MytextField" contains x then find x in fld "MytextField" 
    exit to top 
    end repeat 
end if 
end mouseUp 

现在有几种方法可以做到这一点同样的事情。请考虑检查LC论坛获取更多资源。

克雷格纽曼

+0

它的工作。但是每次我必须输入输入信息。你可以告诉我任何解决它的方法。 – Shalu