Variablendeklaration automatisiert - Opt("MustDeclareVars", 1)

    • Offizieller Beitrag

    Hi,
    beim Skriptschreiben geht es mir immer so, dass ich mit einem Grundgerüst anfange und es dann nach und nach immer mehr wird :)
    Somit ist es oft nicht richtig überschaubar, ob ich die erforderlichen Variablen deklariert habe (was ich versuche immer zu machen).
    Ich habe jetzt ein Skript geschrieben, dass alle Skriptvariablen, die keine Funktionsparameter oder Lokale Funktionsvariablen sind und nicht zu den AutoIt-Konstanten gehören, als Globale Variablen deklariert werden.
    Variablen in Kommentarzeilen oder -blöcken werden ignoriert.
    Es werden wahlweise die Beta- oder Prod-Definitionen herangezogen.
    Bestehende Deklarationen (Dim / Global) bleiben erhalten.
    Es wird nach den Includes und Opt (sofern vorhanden) "Opt("MustDeclareVars", 1)" eingefügt und anschließend werden alle gefundenen, bisher nicht deklarierten Variablen als Global eingeschrieben.
    Das Skript ist somit eine Hilfe um im Nachgang, ohne selbst suchen zu müssen, noch fehlende Variablen zu deklarieren.

    Edit: Zählervariablen in For-Schleifen sind zwar von Haus aus Lokale Variablen - aber eine Globale Deklaration schadet nicht :D und der Aufwand um diese nicht zu deklarieren, wäre extrem hoch - deshalb sind sie hier mit vorhanden.

    Edit 13.09.2008
    Einen Fehler in der Konstantenermittlung korrigiert.

    Spoiler anzeigen
    [autoit]

    ; Version 3.2.12.0
    #include<ProgressConstants.au3>
    #include<StaticConstants.au3>
    #include<EditConstants.au3>
    #include<GUIConstantsEx.au3>
    #include<WindowsConstants.au3>
    #include<File.au3>
    Opt("GUIOnEventMode", 1)
    Opt("MustDeclareVars", 1)
    Global $Skript, $Form1, $Group1, $Input1, $Button1, $Button2, $check, $checked = False, $step, $prog_val = 0, $progress, $lbl

    [/autoit] [autoit][/autoit] [autoit]

    $Form1 = GUICreate('Declare Vars, Opt("MustDeclareVars", 1)', 634, 125, -1, 120)
    GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
    $Group1 = GUICtrlCreateGroup(" au3 - File ", 8, 16, 617, 57)
    $Input1 = GUICtrlCreateInput("", 24, 38, 393, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY))
    $Button1 = GUICtrlCreateButton("Choose", 429, 38, 85, 21, 0)
    GUICtrlSetOnEvent(-1, "Button1Click")
    $Button2 = GUICtrlCreateButton("Start", 527, 38, 85, 21, 0)
    GUICtrlSetOnEvent(-1, "Button2Click")
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $check = GUICtrlCreateCheckbox('Script uses Beta', 8, 76, 150)
    GUICtrlSetOnEvent(-1, 'checkClicked')
    $lbl = GUICtrlCreateLabel('', 287, 79, 60, 17, $SS_CENTER)
    $progress = GUICtrlCreateProgress(7, 98, 620, 20, $PBS_SMOOTH)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    Sleep(100)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func Button1Click()
    GUICtrlSetData($progress, 0)
    GUICtrlSetData($lbl, '')
    $prog_val = 0
    $Skript = FileOpenDialog('Choose an au3-File', @MyDocumentsDir, '(*.au3)')
    If $Skript = '' Then Return
    GUICtrlSetData($Input1, $Skript)
    EndFunc
    Func Button2Click()
    GUICtrlSetData($progress, 0)
    GUICtrlSetData($lbl, '')
    $prog_val = 0
    If $Skript = '' Then Return
    If _SetVarsDeclared($Skript, $checked) = 0 Then
    WinSetTitle($Form1, '', ' << Variables successful declared. >>')
    Else
    WinSetTitle($Form1, '', ' << All variables already declared! >>')
    EndIf
    EndFunc
    Func checkClicked()
    If BitAND(GUICtrlRead($check), $GUI_CHECKED) Then
    $checked = True
    Else
    $checked = False
    EndIf
    EndFunc
    Func Form1Close()
    Exit
    EndFunc
    Func _SetVarsDeclared($FILE, $BETA=False)
    Local $oVars = ObjCreate('System.Collections.ArrayList')
    Local $oFuncVars = ObjCreate('System.Collections.ArrayList')
    Local $oConst = ObjCreate('System.Collections.ArrayList')
    Local $oDeclared = ObjCreate('System.Collections.ArrayList')
    Local $skip = False, $PathInclude, $1stChar, $inFunc = False, $aFile, $aMatch, $var, $strKey, $lastInclude = 1
    Local $str0 = 'Opt("MustDeclareVars", 1)', $str1 = 'Global ', $sLen, $len = 130, $tmp, $keys, $lastOpt = 1, $declare = 0
    If $BETA Then
    $PathInclude = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt', 'betaInstallDir') & '\Include\'
    Else
    $PathInclude = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt', 'InstallDir') & '\Include\'
    EndIf
    Local $aConst_au3 = _FileListToArray($PathInclude, '*.au3', 1)
    $step = 33/UBound($aConst_au3)
    For $i = 1 To UBound($aConst_au3) -1
    $prog_val += $step
    GUICtrlSetData($progress, Int($prog_val))
    GUICtrlSetData($lbl, StringFormat('%3.2f', $prog_val) & '%')
    If Not StringInStr($aConst_au3[$i], 'constants') Then ContinueLoop
    _FileReadToArray($PathInclude & $aConst_au3[$i], $aFile)
    For $k = 1 To UBound($aFile) -1
    $aMatch = StringRegExp($aFile[$k], '\$[\d\w]+', 3)
    If Not IsArray($aMatch) Then ContinueLoop
    For $l = 0 To UBound($aMatch) -1
    If Not $oConst.Contains($aMatch[$l]) Then $oConst.Add($aMatch[$l])
    Next
    Next
    Next
    GUICtrlSetData($progress, 33)
    GUICtrlSetData($lbl, '33.00%')
    _FileReadToArray($FILE, $aFile)
    $tmp = FileRead($FILE)
    Local $pos_incl, $pos_opt, $before_str
    If (StringInStr($tmp, '#include')) Or (StringInStr($tmp, 'Opt')) Then
    For $i = 1 To UBound($aFile) -1
    $1stChar = StringLeft(StringStripWS($aFile[$i],1), 1)
    If ($1stChar <> ';') And (StringInStr($aFile[$i], '#cs') Or StringInStr($aFile[$i], '#comments-start')) Then $skip = True
    If ($1stChar <> ';') And (StringInStr($aFile[$i], '#ce') Or StringInStr($aFile[$i], '#comments-end')) Then $skip = False
    If $skip Then ContinueLoop
    If StringRegExp($aFile[$i], "(?i)#include") Then
    $pos_incl = StringInStr($aFile[$i], '#include')
    If $pos_incl > 1 Then
    $before_str = StringLeft($aFile[$i], $pos_incl-1) ; maybe quoted - don't use then
    If StringInStr($before_str, '"') Or StringInStr($before_str, "'") Then ContinueLoop
    EndIf
    $lastInclude = $i
    ElseIf StringRegExp($aFile[$i], "(?i)opt") Then
    $pos_opt = StringInStr($aFile[$i], 'opt')
    If $pos_opt > 1 Then
    $before_str = StringLeft($aFile[$i], $pos_opt-1) ; maybe quoted - don't use then
    If StringInStr($before_str, '"') Or StringInStr($before_str, "'") Then ContinueLoop
    EndIf
    $lastOpt = $i
    EndIf
    Next
    If $lastOpt > $lastInclude Then $lastInclude = $lastOpt
    EndIf
    $step = 67/UBound($aFile)
    For $i = 1 To UBound($aFile) -1
    $prog_val += $step
    GUICtrlSetData($progress, Int($prog_val))
    GUICtrlSetData($lbl, StringFormat('%3.2f', $prog_val) & '%')
    $1stChar = StringLeft(StringStripWS($aFile[$i],1), 1)
    If $1stChar = ';' Then ContinueLoop
    If StringInStr($aFile[$i], 'Dim') Or StringInStr($aFile[$i], 'Global') Then
    $aMatch = StringRegExp($aFile[$i], '\$[\d\w]+', 3)
    If Not IsArray($aMatch) Then ContinueLoop
    For $k = 0 To UBound($aMatch) -1
    If Not $oDeclared.Contains($aMatch[$k]) Then $oDeclared.Add($aMatch[$k])
    Next
    ContinueLoop
    EndIf
    If StringInStr($aFile[$i], '#cs') Or StringInStr($aFile[$i], '#comments-start') Then $skip = True
    If StringInStr($aFile[$i], '#ce') Or StringInStr($aFile[$i], '#comments-end') Then $skip = False
    If $skip Or ($1stChar = '#') Then ContinueLoop
    If StringLeft(StringStripWS($aFile[$i],1),4) = 'Func' Then
    $inFunc = True
    If $oFuncVars.Count > 0 Then $oFuncVars.Clear
    $aMatch = StringRegExp($aFile[$i], '\$[\d\w]+', 3)
    If Not IsArray($aMatch) Then ContinueLoop
    For $k = 0 To UBound($aMatch) -1
    If Not $oFuncVars.Contains($aMatch[$k]) Then $oFuncVars.Add($aMatch[$k])
    Next
    ContinueLoop
    EndIf
    If $inFunc And (StringLeft(StringStripWS($aFile[$i],1),7) = 'EndFunc') Then $inFunc = False
    $aMatch = StringRegExp($aFile[$i], '\$[\d\w]+', 3)
    If Not IsArray($aMatch) Then ContinueLoop
    If $inFunc And StringInStr($aFile[$i], 'Local') Then
    For $k = 0 To UBound($aMatch) -1
    $oFuncVars.Add($aMatch[$k])
    Next
    ContinueLoop
    EndIf
    For $k = 0 To UBound($aMatch) -1
    If (Not $oVars.Contains($aMatch[$k])) And _
    (Not $oFuncVars.Contains($aMatch[$k])) Then $oVars.Add($aMatch[$k])
    Next
    Next
    GUICtrlSetData($progress, 98)
    GUICtrlSetData($lbl, '98.00%')
    For $strKey In $oConst
    If $oVars.Contains($strKey) Then $oVars.Remove($strKey)
    Next
    For $strKey In $oDeclared
    If $oVars.Contains($strKey) Then $oVars.Remove($strKey)
    Next
    $oVars.Sort
    If $oVars.Count > 0 Then
    For $strKey In $oVars
    $sLen = StringLen($str1 & $strKey & ', ')
    If $sLen < $len Then
    $str1 &= $strKey & ', '
    Else
    $str1 = StringTrimRight($str1, 2) & @LF & 'Global '
    $len += 130
    EndIf
    Next
    If StringRight($str1, 2) = ', ' Then $str1 = StringTrimRight($str1, 2)
    If StringRight($str1, 7) = 'Global ' Then $str1 = StringTrimRight($str1, 7)
    If $declare = 0 Then
    _FileWriteToLine($FILE, $lastInclude +1, $str0 & @CRLF & $str1)
    Else
    _FileWriteToLine($FILE, $declare, $str0, 1)
    _FileWriteToLine($FILE, $lastInclude +1, $str1)
    EndIf
    GUICtrlSetData($progress, 100)
    GUICtrlSetData($lbl, '100.00%')
    Return 0
    Else
    GUICtrlSetData($progress, 100)
    GUICtrlSetData($lbl, '100.00%')
    Return -1
    EndIf
    EndFunc ;==> _SetVarsDeclared

    [/autoit]
    • Offizieller Beitrag

    Hi,
    diese Version ist speziell dafür, um während des Skriptens in SciTE mal schnell per HotKey die Variablendeklaration zu überprüfen/auszuführen.
    Kopiert die Datei SetVarsDeclaredCurrentFile.au3 an einen Ort eurer Wahl (ich hab dafür extra einen Ordner in SciTE angelegt).
    Nun in der SciTEUser.properties(in SciTE: <Optionen> <Benutzer-Einstellungen öffnen>) einen Eintrag erstellen.
    Der Eintrag muß unbedingt vor diesem Block erfolgen:

    Code
    #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
    # START: DO NOT CHANGE ANYTHING AFTER THIS LINE     #-#-#-#-#
    # Created by SciTEConfig
    #------------------------------------------------------------


    Wenn ihr noch keinen Eintrag dort habt, beginnt mit der Nummer 36 statt wie hier 42. Ansonsten einfach fortlaufend nummerieren.

    Code
    # 42 DeclareVars
    command.42.*.au3="$(autoit3dir)\AutoIt3.exe" "$(SciteDefaultHome)\OtherTools\SetVarsDeclaredCurrentFile.au3" "$(FilePath)" "Prod"
    command.name.42.*.au3=Declare Vars
    command.save.before.42.*.au3=1
    command.is.filter.42.*.au3=1
    command.shortcut.42.*.au3=Ctrl+Shift+V


    In der ersten command-Zeile muß nach dem AutoIt-Pfad der Pfad der Datei SetVarsDeclaredCurrentFile.au3 folgen.
    Der erste Parameter "$(FilePath)" übergibt den Dateipfad der au3-Datei, von der aus in SciTE der Aufruf erfolgt.
    Der zweite Parameter "Prod" ist nicht erforderlich, wenn die Prod benutzt wird. Verwendet euer Skript aber die Beta, so muß der Parameter "Beta" übergeben werden!
    Den ShortCut könnt ihr natürlich frei wählen (solang er noch nicht belegt ist ;) ).

    Nun nur in einem beliebigen au3-Skript per Shortcut aufrufen und die Variablendeklaration erfolgt. :rolleyes:

    Spoiler anzeigen
    [autoit]

    ; Version 3.2.12.0
    #include<ProgressConstants.au3>
    #include<StaticConstants.au3>
    #include<GUIConstantsEx.au3>
    #include<WindowsConstants.au3>
    #include<File.au3>
    Opt("GUIOnEventMode", 1)
    Opt("MustDeclareVars", 1)

    [/autoit] [autoit][/autoit] [autoit]

    Global $aLang[4][2] = [ _
    ['Fehler', 'Error'], _
    ['SciTE nicht aktiv!', 'SciTE not active!'], _
    [' << Variablendeklaration erfolgreich beendet. >>', ' << Variables successful declared. >>'], _
    [' << Alle Variablen bereits deklariert! >>', ' << All variables already declared! >>']], $iLang = 0
    If Not StringInStr("0407,0807,0c07,1007,1407", @OSLang) Then $iLang = 1

    [/autoit] [autoit][/autoit] [autoit]

    If Not ProcessExists('SciTE.exe') Then Exit MsgBox(262192, $aLang[0][$iLang], $aLang[1][$iLang])
    If $CmdLine[0] Then
    Global $File2Scan = $CmdLine[1]
    If $CmdLine[0] > 1 Then
    If $CmdLine[2] = 'Beta' Then
    Global $BetaUse = True
    Else
    Global $BetaUse = False
    EndIf
    Else
    Global $BetaUse = False
    EndIf
    Else
    Exit
    EndIf
    Global $GUI, $progress, $lbl, $prog_val = 0, $step

    [/autoit] [autoit][/autoit] [autoit]

    $GUI = GUICreate($File2Scan, 640, 100, -1, 120)
    $progress = GUICtrlCreateProgress(10, 15, 620, 20, $PBS_SMOOTH)
    $lbl = GUICtrlCreateLabel('', 290, 50, 60, 17, $SS_CENTER)
    GUISetOnEvent($GUI_EVENT_CLOSE, "GUIClose")
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    If _SetVarsDeclared($File2Scan, $BetaUse) = 0 Then
    WinSetTitle($GUI, '', $aLang[2][$iLang])
    Else
    WinSetTitle($GUI, '', $aLang[3][$iLang])
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    Sleep(100)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func GUIClose()
    Exit
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _SetVarsDeclared($FILE, $BETA=False)
    Local $oVars = ObjCreate('System.Collections.ArrayList')
    Local $oFuncVars = ObjCreate('System.Collections.ArrayList')
    Local $oConst = ObjCreate('System.Collections.ArrayList')
    Local $oDeclared = ObjCreate('System.Collections.ArrayList')
    Local $skip = False, $PathInclude, $1stChar, $inFunc = False, $aFile, $aMatch, $var, $strKey, $lastInclude = 1
    Local $str0 = 'Opt("MustDeclareVars", 1)', $str1 = 'Global ', $sLen, $len = 130, $tmp, $keys, $lastOpt = 1, $declare = 0
    If $BETA Then
    $PathInclude = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt', 'betaInstallDir') & '\Include\'
    Else
    $PathInclude = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt', 'InstallDir') & '\Include\'
    EndIf
    Local $aConst_au3 = _FileListToArray($PathInclude, '*.au3', 1)
    $step = 33/UBound($aConst_au3)
    For $i = 1 To UBound($aConst_au3) -1
    $prog_val += $step
    GUICtrlSetData($progress, Int($prog_val))
    GUICtrlSetData($lbl, StringFormat('%3.2f', $prog_val) & '%')
    If Not StringInStr($aConst_au3[$i], 'constants') Then ContinueLoop
    _FileReadToArray($PathInclude & $aConst_au3[$i], $aFile)
    For $k = 1 To UBound($aFile) -1
    $aMatch = StringRegExp($aFile[$k], '\$[\d\w]+', 3)
    If Not IsArray($aMatch) Then ContinueLoop
    For $l = 0 To UBound($aMatch) -1
    If Not $oConst.Contains($aMatch[$l]) Then $oConst.Add($aMatch[$l])
    Next
    Next
    Next
    GUICtrlSetData($progress, 33)
    GUICtrlSetData($lbl, '33.00%')
    _FileReadToArray($FILE, $aFile)
    $tmp = FileRead($FILE)
    Local $pos_incl, $pos_opt, $before_str
    If (StringInStr($tmp, '#include')) Or (StringInStr($tmp, 'Opt')) Then
    For $i = 1 To UBound($aFile) -1
    $1stChar = StringLeft(StringStripWS($aFile[$i],1), 1)
    If ($1stChar <> ';') And (StringInStr($aFile[$i], '#cs') Or StringInStr($aFile[$i], '#comments-start')) Then $skip = True
    If ($1stChar <> ';') And (StringInStr($aFile[$i], '#ce') Or StringInStr($aFile[$i], '#comments-end')) Then $skip = False
    If $skip Then ContinueLoop
    If StringRegExp($aFile[$i], "(?i)#include") Then
    $pos_incl = StringInStr($aFile[$i], '#include')
    If $pos_incl > 1 Then
    $before_str = StringLeft($aFile[$i], $pos_incl-1) ; maybe quoted - don't use then
    If StringInStr($before_str, '"') Or StringInStr($before_str, "'") Then ContinueLoop
    EndIf
    $lastInclude = $i
    ElseIf StringRegExp($aFile[$i], "(?i)opt") Then
    $pos_opt = StringInStr($aFile[$i], 'opt')
    If $pos_opt > 1 Then
    $before_str = StringLeft($aFile[$i], $pos_opt-1) ; maybe quoted - don't use then
    If StringInStr($before_str, '"') Or StringInStr($before_str, "'") Then ContinueLoop
    EndIf
    $lastOpt = $i
    EndIf
    Next
    If $lastOpt > $lastInclude Then $lastInclude = $lastOpt
    EndIf
    $step = 67/UBound($aFile)
    For $i = 1 To UBound($aFile) -1
    $prog_val += $step
    GUICtrlSetData($progress, Int($prog_val))
    GUICtrlSetData($lbl, StringFormat('%3.2f', $prog_val) & '%')
    $1stChar = StringLeft(StringStripWS($aFile[$i],1), 1)
    If $1stChar = ';' Then ContinueLoop
    If StringInStr($aFile[$i], 'Dim') Or StringInStr($aFile[$i], 'Global') Then
    $aMatch = StringRegExp($aFile[$i], '\$[\d\w]+', 3)
    If Not IsArray($aMatch) Then ContinueLoop
    For $k = 0 To UBound($aMatch) -1
    If Not $oDeclared.Contains($aMatch[$k]) Then $oDeclared.Add($aMatch[$k])
    Next
    ContinueLoop
    EndIf
    If StringInStr($aFile[$i], '#cs') Or StringInStr($aFile[$i], '#comments-start') Then $skip = True
    If StringInStr($aFile[$i], '#ce') Or StringInStr($aFile[$i], '#comments-end') Then $skip = False
    If $skip Or ($1stChar = '#') Then ContinueLoop
    If StringLeft(StringStripWS($aFile[$i],1),4) = 'Func' Then
    $inFunc = True
    If $oFuncVars.Count > 0 Then $oFuncVars.Clear
    $aMatch = StringRegExp($aFile[$i], '\$[\d\w]+', 3)
    If Not IsArray($aMatch) Then ContinueLoop
    For $k = 0 To UBound($aMatch) -1
    If Not $oFuncVars.Contains($aMatch[$k]) Then $oFuncVars.Add($aMatch[$k])
    Next
    ContinueLoop
    EndIf
    If $inFunc And (StringLeft(StringStripWS($aFile[$i],1),7) = 'EndFunc') Then $inFunc = False
    $aMatch = StringRegExp($aFile[$i], '\$[\d\w]+', 3)
    If Not IsArray($aMatch) Then ContinueLoop
    If $inFunc And StringInStr($aFile[$i], 'Local') Then
    For $k = 0 To UBound($aMatch) -1
    $oFuncVars.Add($aMatch[$k])
    Next
    ContinueLoop
    EndIf
    For $k = 0 To UBound($aMatch) -1
    If (Not $oVars.Contains($aMatch[$k])) And _
    (Not $oFuncVars.Contains($aMatch[$k])) Then $oVars.Add($aMatch[$k])
    Next
    Next
    GUICtrlSetData($progress, 98)
    GUICtrlSetData($lbl, '98.00%')
    For $strKey In $oConst
    If $oVars.Contains($strKey) Then $oVars.Remove($strKey)
    Next
    For $strKey In $oDeclared
    If $oVars.Contains($strKey) Then $oVars.Remove($strKey)
    Next
    $oVars.Sort
    If $oVars.Count > 0 Then
    For $strKey In $oVars
    $sLen = StringLen($str1 & $strKey & ', ')
    If $sLen < $len Then
    $str1 &= $strKey & ', '
    Else
    $str1 = StringTrimRight($str1, 2) & @LF & 'Global '
    $len += 130
    EndIf
    Next
    If StringRight($str1, 2) = ', ' Then $str1 = StringTrimRight($str1, 2)
    If StringRight($str1, 7) = 'Global ' Then $str1 = StringTrimRight($str1, 7)
    If $declare = 0 Then
    _FileWriteToLine($FILE, $lastInclude +1, $str0 & @CRLF & $str1)
    Else
    _FileWriteToLine($FILE, $declare, $str0, 1)
    _FileWriteToLine($FILE, $lastInclude +1, $str1)
    EndIf
    GUICtrlSetData($progress, 100)
    GUICtrlSetData($lbl, '100.00%')
    Return 0
    Else
    GUICtrlSetData($progress, 100)
    GUICtrlSetData($lbl, '100.00%')
    Return -1
    EndIf
    EndFunc ;==> _SetVarsDeclared

    [/autoit]

    Edit 13.09.08:
    Hatte einen Schleifenfehler und dadurch nicht alle Konstanten erfaßt - aber nun korrigiert. ;)

  • Hi

    Sehr schön :rock:
    sowas hab ich schon gesucht (und leider damals übersehen ;))

    Ich hab das jetzt nicht extra überprüft, aber ich nehme mal an, daß du alle Variablen, welche in einer Global/Local/Dim-Zeile stehen als schon deklariert betrachtest...
    In folgender Zeile wird jedoch nur $AccelKeys deklariert:

    [autoit]

    Dim $AccelKeys[5][2]=[["{UP}", $AccUp], ["{DOWN}", $AccDown], ["{TAB}", $AccTab], ["+{TAB}", $AccSTab], ["{Enter}", $AccEnter]]

    [/autoit]


    alle weiteren nicht, trotzdem von deinem Script übersprungen.

    Solche Fälle sollten aber eher die Ausnahme sein;
    Aber wenn du Lust und Zeit hast, dann könntest du dieses Feature noch hinzufügen... ^^

    lgE