Heoagua Posted September 9, 2015 Share Posted September 9, 2015 Dear,I coded a auto utility with autoit-v3 and now I'm using autoit-v3.3.14.1 to prepare and upgrade but get following error:Subscript used on non-accessible variable.:For $i=1 to $aArray[0][0]-1For $i=1 to $aArray^ ERRORPlease help meThanks! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 9, 2015 Moderators Share Posted September 9, 2015 Heoagua,Welcome to the AutoIt forum.The error is obviously at line 238745.... ....which is as sensible answer as you will get unless you let us see the code you are using - although we can say immediately that it would seem you have an array dimension mismatch. When you do post your code please use Code tags - see here how to do it.M23 Heoagua 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Heoagua Posted September 10, 2015 Author Share Posted September 10, 2015 The error message also reports the line number. Just click on the error message to take you to it as well.Thank for ur soon replyHere is my code:Func _cmdActionFIMI()Local $tmpNotice,$Result[6],$tmpRecNo=1,$Addr="https://.....com.vn",$OpenLocal $Update,$CardNo,$aArray,$ListNo=0,$FListFinish=0,$oIE,$tmpCondition,$GetID=False ;$oIE=_LoginFIMI($FUserName,_Decode($FPassword),$Addr) $oIE=1 If $oIE=0 Then Return 0 EndIf ToolTip("OPENNING "&$FXLSPath) $oExcel = _Excel_Open($FXLSPath,1) If $oExcel=0 Then Switch @error Case 1 MsgBox(0, "Óe !!!", "Cannot open !") Case 2 MsgBox(0, "Óe !!!", "Not find file !") EndSwitch ToolTip("") Return 0 EndIf _Excel_BookOpen($oExcel, "nhaplieu") ;$Open=Not (_ExcelReadCell($oExcel,13,5)="Đóng thẻ") ;If $Open Then ; MsgBox(0,"o",$Open) ;EndIf ;Exit _Excel_BookOpen($oExcel, "ketqua") $aArray=_Excel_RangeRead($oExcel) For $i=1 to $aArray[0][0]-1 If $aArray[$i+1][2]<>"" Then $ListNo+=1 Next For $i=1 to $ListNo If $aArray[$i+1][4]<>"" Then $FListFinish+=1 Next Do $CardNo=$aArray[$tmpRecNo+1][2] $Update=$aArray[$tmpRecNo+1][4] If $Update="" Then If GUICtrlRead($chkID)=$GUI_CHECKED Then $GetID=True $Result=_Input1CardNo($FListFinish+1,$ListNo,$CardNo,$Addr,$oIE,$GetID,$Open) $FListFinish+=1 $tmpCondition='DPType="'&StringMid($Result[2],5,3)&'" AND Acct="'&StringRight($Result[2],6)&'"' $tmpNotice=StringReplace(_GetValue("Notice","CIF",$tmpCondition),4,$Result[0]) _SQLite_Exec(-1, 'UPDATE CIF SET Notice="'&$tmpNotice&'" WHERE '&$tmpCondition) _SQLite_Exec(-1, 'UPDATE CIF SET CardNo="'&$CardNo&'" WHERE '&$tmpCondition) _Excel_RangeWrite($oExcel,$Result[1],$tmpRecNo+1,3) _Excel_RangeWrite($oExcel,$Result[2],$tmpRecNo+1,4) _Excel_RangeWrite($oExcel,$Result[3],$tmpRecNo+1,5) _Excel_RangeWrite($oExcel,$Result[4],$tmpRecNo+1,6) _Excel_RangeWrite($oExcel,$Result[5],$tmpRecNo+1,7) EndIf $tmpRecNo+=1 Until $tmpRecNo>$ListNo ToolTip("") MsgBox(0,"OK!","I've finished!!!")EndFuncRegards Link to comment Share on other sites More sharing options...
kylomas Posted September 10, 2015 Share Posted September 10, 2015 Heoagua,Check the error code returned from this...$aArray=_Excel_RangeRead($oExcel)See the Help file for possible codes.Please post code in code tags. "<>" on the toolbar.kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Heoagua Posted September 10, 2015 Author Share Posted September 10, 2015 expandcollapse popupFunc _cmdActionFIMI() Local $tmpNotice,$Result[6],$tmpRecNo=1,$Addr="https://.....com.vn",$Open Local $Update,$CardNo,$aArray,$ListNo=0,$FListFinish=0,$oIE,$tmpCondition,$GetID=False ;$oIE=_LoginFIMI($FUserName,_Decode($FPassword),$Addr) $oIE=1 If $oIE=0 Then Return 0 EndIf ToolTip("OPENNING "&$FXLSPath) $oExcel = _Excel_Open($FXLSPath,1) If $oExcel=0 Then Switch @error Case 1 MsgBox(0, "Óe !!!", "Cannot open !") Case 2 MsgBox(0, "Óe !!!", "Not find file !") EndSwitch ToolTip("") Return 0 EndIf _Excel_BookOpen($oExcel, "nhaplieu") ;$Open=Not (_ExcelReadCell($oExcel,13,5)="Đóng thẻ") ;If $Open Then ; MsgBox(0,"o",$Open) ;EndIf ;Exit _Excel_BookOpen($oExcel, "ketqua") $aArray=_Excel_RangeRead($oExcel) For $i=1 to $aArray[0][0]-1 If $aArray[$i+1][2]<>"" Then $ListNo+=1 Next For $i=1 to $ListNo If $aArray[$i+1][4]<>"" Then $FListFinish+=1 Next Do $CardNo=$aArray[$tmpRecNo+1][2] $Update=$aArray[$tmpRecNo+1][4] If $Update="" Then If GUICtrlRead($chkID)=$GUI_CHECKED Then $GetID=True $Result=_Input1CardNo($FListFinish+1,$ListNo,$CardNo,$Addr,$oIE,$GetID,$Open) $FListFinish+=1 $tmpCondition='DPType="'&StringMid($Result[2],5,3)&'" AND Acct="'&StringRight($Result[2],6)&'"' $tmpNotice=StringReplace(_GetValue("Notice","CIF",$tmpCondition),4,$Result[0]) _SQLite_Exec(-1, 'UPDATE CIF SET Notice="'&$tmpNotice&'" WHERE '&$tmpCondition) _SQLite_Exec(-1, 'UPDATE CIF SET CardNo="'&$CardNo&'" WHERE '&$tmpCondition) _Excel_RangeWrite($oExcel,$Result[1],$tmpRecNo+1,3) _Excel_RangeWrite($oExcel,$Result[2],$tmpRecNo+1,4) _Excel_RangeWrite($oExcel,$Result[3],$tmpRecNo+1,5) _Excel_RangeWrite($oExcel,$Result[4],$tmpRecNo+1,6) _Excel_RangeWrite($oExcel,$Result[5],$tmpRecNo+1,7) EndIf $tmpRecNo+=1 Until $tmpRecNo>$ListNo ToolTip("") MsgBox(0,"OK!","I've finished!!!") EndFunc Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now