2007年4月4日 星期三

偽.雲圖產生器.改

之前在主任要求下寫了一段Script,用來應付「即時氣象」沒有下載到雲層圖的情況。不過是批次的複製、貼上、改檔名的程序罷了!而今天有人提到當初的參考日是選同事結婚當天作參考點(因為是黃道吉日),而該日是屬於晴天雲層較稀疏。所以應該新增壞天氣的對照組來應天候使用。所以...小改了一下。


dim i,cwc,climate,climate_cht,cwc2,s1,s2,s3,ndn
Set fs = CreateObject("Scripting.FileSystemObject")
s1=day(date)
s2=Month(date)
s3=year(date)
if len(s1)<2 then s1="0" & s1
if len(s2)<2 then s2="0" & s2
ndn=s3 & "-" & s2 & "-" & s1
cwc = inputbox("輸入需要產生圖檔之日期","Day",ndn)
climate = inputbox("選擇天氣 0:黃道吉日 ; 1:壞天氣","climate",0)

If climate = 0 then climate_cht = "auspicious_day" else climate_cht = "overcast_day"
If fs.FolderExists(cwc) = True then fs.DeleteFolder cwc , True

fs.CreateFolder(cwc)
for i = 0 to 9
cwc2 = cwc & "\" & cwc & "_0" & i & ".jpg"
fs.CopyFile climate_cht & "\n0" & i & ".jpg", cwc2
next

for i = 10 to 23
cwc2 = cwc & "\" & cwc & "_" & i & ".jpg"
fs.CopyFile climate_cht & "\n" & i & ".jpg", cwc2
next

沒有留言: