- namespace TBDT
 
  
- thread1
 
 - timu = array[]
 
 - daan = array[]
 
 - quantimu = array[]
 
 - //三个数组,用来记录,减少运行时间
 
  
- function main()  //个函数是主函数
 
 -     i = 1
 
 -     handle1 = file.openfile("rc:题目.txt")
 
 -     handle2 = file.openfile("rc:答案.txt")
 
 -     handle3 = file.openfile("rc:淘宝题目.txt")
 
 -     //打开文件,获得文件句柄,为下面的读取做准备
 
 -     while(true)
 
 -         text = file.readfileline(handle1)
 
 -         daantext = file.readfileline(handle2)
 
 -         timutext = file.readfileline(handle3)
 
 -         if(text == "")
 
 -             break
 
 -         endif
 
 -         list.addstring("list0",timutext)
 
 -         arraysp.add(timu, text, 1)
 
 -         arraysp.add(daan, daantext, 1)
 
 -         arraysp.add(quantimu, timutext, 1)
 
 -         //把题目,答案,预存入数组中,用于遍历
 
 -     endwhile
 
 -     file.closefile(handle1)
 
 -     file.closefile(handle2)
 
 -     file.closefile(handle3)
 
 - endfunction
 
  
- function Clear(strtext) //清楚题目中的字符,方便查找
 
 -     strtext = str.strcut(strtext,4, true)
 
 -     strtext = str.strcut(strtext,2, false)
 
 -     str1 = str.replace(strtext,",","")
 
 -     str2 = str.replace(str1, "、", "")
 
 -     str3 = str.replace(str2, ":", "")
 
 -     str4 = str.replace(str3,",","")
 
 -     str5 = str.replace(str4, ":", "")
 
 -     return str5
 
 - endfunction
 
  
- function start_click()
 
 -     text = edit.gettext("edit0")
 
 -     retext = TBDT.Clear(text) //清理上次的搜素记录
 
 -     len
 
 -     arraysp.size(timu,len)
 
 -     list.deleteall("list1")
 
 -     for(i=0;i<len;i++)
 
 -         if(str.findstr(timu[i], retext) >= 0)
 
 -             list.addstring("list1",quantimu[i])
 
 -             list.addstring("list1", daan[i])
 
 -         endif
 
 -     endfor
 
 - endfunction
 
  
- function exit_click()
 
 -     thread.closethread(thread1)
 
 -     help.exit()
 
 - endfunction
 
  
 
- function init()
 
 -         thread1 = thread.beginthread("TBDT.main","")
 
 - endfunction
 
  
 
- function edit0_setfocus()
 
 -         edit.settext("edit0","")
 
 -         //编辑框点击时,清楚上次的查找内容
 
 - endfunction
 
  
- endnamespace
 
  复制代码 http://pt.tyuyan.com/soft-FB98085F9F8D6D0FB8A4500A24A36743淘宝答题的平台链接 
 
  
 |