美文网首页
2019-04-27

2019-04-27

作者: 景知育德 | 来源:发表于2019-04-27 11:09 被阅读0次
    fullText = getClipBoardText ()
    fullText = rpSubText (fullText, “\n”, “”, , , 真)
    byteSet = toBin (fullText)
    length = binLen (byteSet) ÷ 2
    
    fputs (, “【程序】程序开始运行。\n”)
    
    .counter (length - 1, i)
        .if (byteSet [2 × i - 1] < 127)
            fputs (, “【错误】文本不合法!\n”)
            fputs (, “【错误】错误位置:” + str (i) + “\n”)
            fputs (, “【错误】错误前五个字:” + str (binMid (byteSet, 2 × i - 11, 10)) +“\n”)
            return (0)
        .if end
    
    
        currentWord = str (binMid (byteSet, 2 × i - 1, 4))
        flag = false
        .counter (getAryElementCount (words), j)
            .if (words [j].text = currentWord)
                words [j].num = words [j].num + 1
                flag = ture
            .if end
    
        .counter end ()
        .if (flag = false)
            newWord.text = currentWord
            newWord.num = 1
            addElement (words, newWord)
        .if end
    
    .counter end ()
    
    fputs (, “【程序】统计完毕,正在保存到硬盘。\n” )
    
    .counter (getAryElementCount (words), j)
        record = words [j].text + “,” + str (words [j].num) + "\n"
        byteSet = byteSet + toBin (record)
    .counter end ()
    writeFile (“D:\二字词统计.csv”, byteSet)
    fputs (, “【程序】输出完毕”)
    return (0)  
    

    相关文章

      网友评论

          本文标题:2019-04-27

          本文链接:https://www.haomeiwen.com/subject/ejihnqtx.html