|
本帖最后由 jiaosc 于 2014-7-6 17:25 编辑
求助:带有 File Line UDF函数的脚本在Win XP系统下运行正常,Win7下报错,提示信息如下:
+>11:27:28 开始 AccAu3Wrapper v.1.1.2.1 SciTE v.3.4.1.0 键盘布局:00000804 操作系统:WIN_7/Service Pack 1 CPU:X64 系统架构:X64 环境(语言:0804)
+> SciTE目录 => C:\Program Files (x86)\AutoIt3\SciTE 用户目录 => C:\Users\jiaosc\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\jiaosc\AppData\Local\AutoIt v3\SciTE
>运行 AU3Check (3.3.12.0) 从:C:\Program Files (x86)\AutoIt3
"E:\NezipFox\FileLineUDF .AU3"(486,46) : error: _ArraySwap() called with wrong number of args.
_ArraySwap($Arr[$x], $Arr[$x - 1])
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(2054,93) : REF: definition of _ArraySwap().
Func _ArraySwap(ByRef $avArray, $iIndex_1, $iIndex_2, $bRow = False, $iStart = 0, $iEnd = 0)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"E:\NezipFox\FileLineUDF .AU3"(490,46) : error: _ArraySwap() called with wrong number of args.
_ArraySwap($Arr[$x], $Arr[$x + 1])
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(2054,93) : REF: definition of _ArraySwap().
Func _ArraySwap(ByRef $avArray, $iIndex_1, $iIndex_2, $bRow = False, $iStart = 0, $iEnd = 0)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
E:\NezipFox\FileLineUDF .AU3 - 2 error(s), 0 warning(s)
!>11:27:28 AU3Check 语法检查结束. 按F4键跳转到下一个错误.rc:2
+>11:27:28 AccAu3Wrapper 完成.
>Exit code: 0 Time: 0.583
FileLineUDF.au3函数出错提示位置:
===============================================================================================================================
Func _FileLineMove($FilePath, $From, $TO)
If Not _IsFileOpen($FilePath) Then
SetError(1)
Return 0
EndIf
If Not _FileLineExists($FilePath, $From) Or Not _FileLineExists($FilePath, $TO) Then
SetError(2)
Return 0
EndIf
Local $Arr
_FileReadToArray($FilePath, $Arr)
If @error Then
SetError(@error)
Return 0
EndIf
If $From > $TO Then
For $x = $From To $TO + 1 Step -1
_ArraySwap($Arr[$x], $Arr[$x - 1])→ error: _ArraySwap() called with wrong number of args.
Next
Else
For $x = $From To $TO - 1 Step 1
_ArraySwap($Arr[$x], $Arr[$x + 1])→ error: _ArraySwap() called with wrong number of args.
Next
EndIf
Local $FO = FileOpen($FilePath, 2)
If $FO = -1 Then
SetError(1)
Return 0
EndIf
For $x = 1 To UBound($Arr) - 1
FileWriteLine($FO, $Arr[$x])
Next
FileClose($FO)
Return 1
EndFunc ;==>_FileLineMove
; #FUNCTION# ====================================================================================================================
; Author ........: Melba23
; Modified.......:
; ===============================================================================================================================
Func _ArraySwap(ByRef $avArray, $iIndex_1, $iIndex_2, $bRow = False, $iStart = 0, $iEnd = 0)→ REF: definition of _ArraySwap().
求大师指教如何解决? |
|