用乙個例子說明VBS語法

2021-04-21 07:33:09 字數 913 閱讀 4134

dim arrcmdline(200)

dim ntotalcmdline

arrcmdline(1) = "sdfasdf"

arrcmdline(2) = "sdfasdf"

arrcmdline(3) = "gettrafile:file=tf.cpxx.cy1,beg=yy-mm-dd,ter=yy-mm-dd, iv=hh-mm-hh-mm;"

ntotalcmdline = 3

for tt = 1 to ntotalcmdline

if  arrcmdline(tt) = "gettrafile:file=tf.cpxx.cy1,beg=yy-mm-dd,ter=yy-mm-dd, iv=hh-mm-hh-mm;" then

varyear  = year(now)

varyear  = right(varyear,2)

varmonth = month(now)

varday   = day(now)

arrcmdline(tt) = "gettrafile:file=tf.cpxx.cy1,beg=" & varyear & "-" & varmonth & "-" & varday &",ter=" & varyear & "-" & varmonth & "-" & varday & ",iv=10-00-11-00;"

end if

next

msgbox arrcmdline(3) 

1.陣列定義和引用用()

2.定義陣列dim arra(200) 則有201個元素 ,arra(0)~arra(200),我們一般都是從1開始賦值,方便遍歷

for tt = 1 to ntotalcmdline  能取到ntotalcmdline

3.等號和賦值號 等價

4.vbs中的函式真豐富啊

乙個例子讓你理解Generator語法

function foo let generator foo 返回迭代器例項 指標物件 console.log generator.next 111 console.log generator.next aaaa console.log generator.next console.log gene...

LineDDA的乙個例子

unit unit1 inte ce uses windows,messages,sysutils,variants,classes,graphics,controls,forms,dialogs,extctrls,stdctrls,buttons type tfmmain class tform ...

SQL GROUP CONCAT的乙個例子

我有乙個這樣的資料庫 user info 現在有乙個需求是把這樣 9 條記錄按照 username 來 group 成3條記錄 目標 shu female 201 lee male 202 yuki female 181 如果用select from user info group by usern...