Home > Database > Mysql Tutorial > silktest 技巧积累<一>

silktest 技巧积累<一>

WBOY
Release: 2016-06-07 15:11:43
Original
998 people have browsed it

Setting this option to FALSE suppresses "control notresponding" errors. 13. 等待鼠标状态。 [-] void WaitForMouseIdle(integeriTimeOut) [ ] integeriTime=1 [-]while(Cursor.GetType()=="WAIT" || Cursor.GetType()=="DELAY" iTime iTimeOut) [ ] sle

Setting this option to FALSE suppresses "control not responding" errors.

13. 等待鼠标状态。

 [-] void WaitForMouseIdle(integer iTimeOut)
    [ ] integer iTime=1
    [-] while(Cursor.GetType()=="WAIT" || Cursor.GetType()=="DELAY" && iTime         [ ] sleep(1)
        [ ] iTime = iTime+5
        [-] if(iTime > iTimeOut)
            [ ] Log.Fail("Cursor status is not idle in {iTimeOut} seconds")
    [ ] sleep(5)

14. 使用 ListRead()从一个文本中读取list变量,是一种数据驱动的好办法。

         List of string lsFileContents

         ListRead(lsFileContents,"C:\test.txt")    

         ListPrint(lsFileContents)

   ListInsert (lsFile, i, lsNewInfo[i]) 

   ListWrite (lsFile, "{GetProgramDir ()}\Sample.txt")

15. silktest 中使用递归实现清空文件夹内容方法:

 
    [+] void glClearFolder(String filepath)
        [+] //---------------------Log---------------------//
            [ ] // Author           Cheers Li
            [ ] // Date               2009-09-15
            [ ] //-----------------------------------------------//
        [ ] filepath=Trim(filepath)
        [+] if(SubStr(filepath,Len(filepath),1)=="")
            [ ] filepath=SubStr(filepath,1,Len(filepath)-1)
        [+] else
            [ ] filepath=SubStr(filepath,1,Len(filepath))
        [ ] String tempfilepath
        [ ] String tmDir
        [+] if(!SYS_DirExists(filepath))
            [ ] RaiseError(13,"The path : {filepath} does not exists! ")
        [ ] List of FILEINFO fFileContents=SYS_GetDirContents(filepath)
        [-] FILEINFO item
            [-] for each item in fFileContents
                [ ] tempfilepath="{filepath}"+item.sName
                [-] if(item.bIsDir)
                    [-] if(ListCount(SYS_GetDirContents(tempfilepath))==0)
                        [ ] SYS_RemoveDir(tempfilepath)
                    [-] else
                        [ ] glClearFolder(tempfilepath)
                        [ ] SYS_RemoveDir(tempfilepath)
  
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template