关于文件存在检测出错,请高手指点。
本帖最后由 a000000 于 2009-8-18 21:46 编辑源码如下:
$DAY = @MDAY - 1
$MON = @MON + 0
$YEAR = @YEAR
If $DAY = 00 Then
$MON = @MON - 1
Switch $MON
Case 0
$YEAR = @YEAR - 1
$MON = 12
$DAY = 31
Case 1, 3, 5, 7, 8, 10
$DAY = 31
Case 2
$YEAR = @YEAR - 2E3
Do
$YEAR -= 4
If $YEAR = 0 Then $DAY = 29
If $YEAR < 0 Then $DAY = 28
Until $DAY = 0 Or $DAY < 0
Case 4, 6, 9, 11
$DAY = 30
EndSwitch
EndIf
If $DAY < 10 Then $DAY = '0' & $DAY
If $MON < 10 Then $MON = '0' & $MON
$NUM='_'&$YEAR&'年'&$MON&'月'&$DAY&'日_早班+晚班.htm'
If FileExists(".\$NUM") Then
MsgBox(4096, "$NUM文件", "存在")
Else
MsgBox(4096,"$NUM文件", "不存在")
EndIf $DAY = @MDAY - 1
$MON = @MON + 0
$YEAR = @YEAR
If $DAY = 00 Then
$MON = @MON - 1
Switch $MON
Case 0
$YEAR = @YEAR - 1
$MON = 12
$DAY = 31
Case 1, 3, 5, 7, 8, 10
$DAY = 31
Case 2
$YEAR = @YEAR - 2E3
Do
$YEAR -= 4
If $YEAR = 0 Then $DAY = 29
If $YEAR < 0 Then $DAY = 28
Until $DAY = 0 Or $DAY < 0
Case 4, 6, 9, 11
$DAY = 30
EndSwitch
EndIf
If $DAY < 10 Then $DAY = '0' & $DAY
If $MON < 10 Then $MON = '0' & $MON
$NUM='_'&$YEAR&'年'&$MON&'月'&$DAY&'日_早班+晚班.htm'
If FileExists($NUM) Then
MsgBox(4096, "$NUM文件", "存在")
Else
MsgBox(4096,"$NUM文件", "不存在")
EndIf 这是要干什么,那个赋值有问题,$DAY, $month, $year能这样赋值吗,没引号吧 谢谢afan帅哥,问题解决
页:
[1]