Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

[Help] Declaring an array with a variable & "For" missing Next & FileInstall error

$
0
0

Hello fellow coders, today my problem is that I can't declare an array using a variable. Also the SyntaxCheck doesn't recognize the "Next". Maybe it's because of the Array error, but I dunno. Script:

AutoIt         
Func LocalSearch()     Local $Success = 0     Local $sSearchedFoundCount = 0     Local $sWantedWord = InputBox("Search", "Enter the word you want to search.")     For $i = 0 To $CurrentDicSize Step 1         Local $sTmpArray = StringSplit(IniRead($DicIni, "Vocabs", "Voc" & $i, ""),"|")         If StringInStr($sTmpArray[2], $sWantedWord) <> 0 Then             Local $Success = 1             Local $sLocalSearchArray[$sSearchedFoundCount] = $i ;The error occurs here. (ERROR: syntax error)             $sSearchedFoundCount + 1         ElseIf StringInStr($sTmpArray[3], $sWantedWord) <> 0 Then             Local $Success = 1             Local $sLocalSearchArray[$sSearchedFoundCount] = $i             $sSearchedFoundCount + 1         EndIf     Next ;Here is the Next, which isn't recognized.     If $Success = 1 Then         _GUICtrlListView_BeginUpdate($ListView1)         _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($ListView1))         For $i = 0 To $sSearchedFoundCount Step 1             Local $sTmpArray = StringSplit(IniRead($DicIni, "Vocabs", "Voc" & $i, ""), "|", 1)             _GUICtrlListView_AddItem($ListView1, $sTmpArray[1])             _GUICtrlListView_AddSubItem($ListView1, $i, $sTmpArray[2], 1)             _GUICtrlListView_AddSubItem($ListView1, $i, $sTmpArray[3], 2)         Next             MsgBox(0, "List", "If you want to see the Main List again, press: STRG+ALT+ESC, or press hide/show spanish." & @CRLF & '"Hide spanish" does NOT work with search results!')             _HotKey_Assign(BitOR($CK_CONTROL, $CK_ALT, $VK_ESCAPE), "ReDrawListView")             _HotKey_Enable()     Else             MsgBox(0, "Not found", "I haven't found anything, please use the translate online button, or redefine your search term!")     EndIf EndFunc   ;==>LocalSearch

All vars used, are already declared smoothly. Also, for some reason the FileInstall() func, does't work anymore since I patched to the latest "automatic installer" beta, also now of a sudden, the includes are messed up. I'm always getting already declared erros, before it worked fine. It's a pain to test with "Go", if you're used to "Beta-Run" :/ BTW: I also attached my main script folder with everything, I hope it's easier for you with it.

FileInstall("C:\Benutzer\Jonniy\Downloads\Autoit\Spanisch\dic.ini", @AppDataDir & "\dic.ini", 1)

It worked before, so it can't be me I think.

Attached Files


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>