確實還是字典法方便

2021-07-11 03:08:18 字數 1206 閱讀 7509

好久沒有來充數了,廢話也是要寫寫的。

終於稍微嘗到了一點oo的甜頭。因為一直用不好oo,一直逃避,能不用就不用。正則什麼的,都是沒辦法了才用。這次為了頁面和**的簡單易懂,在不重複list的問題上,還是選擇了字典法。

'********************************apt vs tpt

dim dictest as object

set dictest = createobject("scripting.dictionary")

for i = 2

to sheet6.usedrange.rows.count

iftrim(sheet6.cells(i, 2)) = "3.test file received"

then

x = trim(sheet6.cells(i, 3).value) & "||" & trim(sheet6.cells(i, 8).value)

ifnot dictest.exists(x) then

dictest.add x, x

endifend

ifnext i

krr = dictest.items

arr = dictest.items

brr = dictest.items

for i = 0

toubound(krr)

arr(i) = split(krr(i), "||")(0)

brr(i) = split(krr(i), "||")(1)

next i

for k = 0

toubound(krr)

if arr(k) = "apt"

then

sapt = sapt + 1

endif

if arr(k) = "tpt"

then

stpt = stpt + 1

endif

next k

if (stpt + sapt) <> dictest.count then

msgbox

"some file type may not be entered by drm, please check!"

exit

subend

if'********************start preparing table @ sheet7

Python殺死Excel!確實方便便捷!

python在不同行業中的應用,越來越廣泛。1 券商副首席 python已取代excel 野村 副首席馬修 漢普森在最近舉行的quant conference上明確表示 python已經取代了excel。現在穿過我們的交易大廳,交易員都在用python寫 各大券商一直追求更高的效率和質量,excel...

LINQ還是很方便的

很長時間沒有linq了,除了知道linq外,基本上都忘了。昨天快下班時,乙個專案要統計圖中的圖塊 blockreference 數量及位置資訊,開始還想自己寫排序及分組的 忽然想到可以使用linq,這使得 簡單了很多很多。使用linq排序 分組 var group from blk in blks ...

js常見的幾種封裝方法,方便呼叫

事件委託的封裝 function eveent child,cb 事件監聽式繫結事件 function addevent ele,type,cb else 阻止事件冒泡封裝 function stopbubble eve else 獲取行內樣式的相容 function getstyle ele,at...