Moin
erstaml hier ein Testscript
Spoiler anzeigen
[autoit]
HotKeySet("{ESC}","_exit")
HotKeySet("t","test")
While 1
Sleep(100)
WEnd
Func test()
Global $Test = 10
MsgBox(0,"",test2())
EndFunc
Func test2()
Return $Test*2
EndFunc
Func _exit()
Exit
EndFunc
und hier die Fehlermeldung dazu
Spoiler anzeigen
Code
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\test.au3(14,14) : WARNING: $Test: possibly used before declaration.
Return $Test*
~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\test.au3(9,19) : WARNING: $Test: declared global in function only. Prefer top of file.
Global $Test = 10
~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\test.au3 - 0 error(s), 2 warning(s)
wieso bekomme ich hier solche Fehlermeldungen, obwohl die Variable überhaupt noch nicht benutzt wurde?
Außerdem geht das gaze soweit, dass ich in einem anderen etwas längeren Script das hier bekomm.
Spoiler anzeigen
Code
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\MyHover.au3(24,77) : WARNING: $aGUI_Register_Hover_Info: possibly used before declaration.
Local $aGUI_Register_Hover_Infos = StringSplit($aGUI_Register_Hover_Info[1],
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\MyHover.au3(33,18) : WARNING: $Hover_one: possibly used before declaration.
If $Hover_one <>
~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\MyHover.au3(87,19) : WARNING: $Leave_one: possibly used before declaration.
Return $Leave_one
~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(361,33) : WARNING: $hBuffer: possibly used before declaration.
_GDIPlus_GraphicsClear($hBuffer,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(363,49) : WARNING: $hBack_Pic: possibly used before declaration.
_GDIPlus_GraphicsDrawImage($hBuffer, $hBack_Pic,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(364,48) : WARNING: $hBuffer_Header: possibly used before declaration.
_GDIPlus_GraphicsDrawImageRect($hBuffer_Header,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(364,65) : WARNING: $hBack_Pic_oben: possibly used before declaration.
_GDIPlus_GraphicsDrawImageRect($hBuffer_Header, $hBack_Pic_oben,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(368,44) : WARNING: $ID_UP: possibly used before declaration.
If GUI_Reguster_Witch_Hovered() = $ID_UP Then
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(369,115) : WARNING: $FR_Brush_H_Up_Down: possibly used before declaration.
_GDIPlus_GraphicsFillRect($hBuffer_Header,$aLab_up[0],$aLab_up[1],$aLab_up[2],$aLab_up[3],$FR_Brush_H_Up_Down)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(371,110) : WARNING: $FR_Brush_Up_down: possibly used before declaration.
_GDIPlus_GraphicsFillRect($hBuffer_Header,$aLab_up[0],$aLab_up[1],$aLab_up[2],$aLab_up[3],$FR_Brush_Up_down)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(373,46) : WARNING: $ID_Down: possibly used before declaration.
If GUI_Reguster_Witch_Hovered() = $ID_Down Then
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(381,75) : WARNING: $hFont: possibly used before declaration.
$aInfo = _GDIPlus_GraphicsMeasureString($hBuffer_Header, $sString, $hFont,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(381,95) : WARNING: $hFormat: possibly used before declaration.
$aInfo = _GDIPlus_GraphicsMeasureString($hBuffer_Header, $sString, $hFont, $tLayout, $hFormat)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(382,96) : WARNING: $hBrush2: possibly used before declaration.
_GDIPlus_GraphicsDrawStringEx($hBuffer_Header, $sString, $hFont, $aInfo[0], $hFormat, $hBrush2)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(385,59) : WARNING: $hNext_GB: possibly used before declaration.
_GDIPlus_GraphicsDrawImageRect($hBuffer_Header, $hNext_GB,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(385,73) : WARNING: $aNext_GB: possibly used before declaration.
_GDIPlus_GraphicsDrawImageRect($hBuffer_Header, $hNext_GB, $aNext_GB[0],
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(394,53) : WARNING: $Next_GP_ueb_Pos: possibly used before declaration.
$tLayout = _GDIPlus_RectFCreate($Next_GP_ueb_Pos[0],
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(401,53) : WARNING: $Next_GP_Sec_Pos: possibly used before declaration.
$tLayout = _GDIPlus_RectFCreate($Next_GP_Sec_Pos[0],
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(409,53) : WARNING: $Next_GP_Min_Pos: possibly used before declaration.
$tLayout = _GDIPlus_RectFCreate($Next_GP_Min_Pos[0],
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(416,55) : WARNING: $Next_GP_Houre_Pos: possibly used before declaration.
$tLayout = _GDIPlus_RectFCreate($Next_GP_Houre_Pos[0],
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(423,53) : WARNING: $Next_GP_Day_Pos: possibly used before declaration.
$tLayout = _GDIPlus_RectFCreate($Next_GP_Day_Pos[0],
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(428,53) : WARNING: $Next_GP_Nam_Pos: possibly used before declaration.
$tLayout = _GDIPlus_RectFCreate($Next_GP_Nam_Pos[0],
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(432,73) : WARNING: $hFlags: possibly used before declaration.
_GDIPlus_GraphicsDrawImage($hBuffer_Header, $hFlags[$hNext_Race_Flag+1],
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(436,90) : WARNING: $hFont_next_race_date: possibly used before declaration.
$aInfo = _GDIPlus_GraphicsMeasureString($hBuffer_Header, $sString, $hFont_next_race_date,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(436,125) : WARNING: $hFormat_next_race_date: possibly used before declaration.
$aInfo = _GDIPlus_GraphicsMeasureString($hBuffer_Header, $sString, $hFont_next_race_date, $tLayout, $hFormat_next_race_date)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(437,140) : WARNING: $hBrush_next_race_date: possibly used before declaration.
_GDIPlus_GraphicsDrawStringEx($hBuffer_Header, $sString, $hFont_next_race_date, $aInfo[0], $hFormat_next_race_date, $hBrush_next_race_date)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(440,48) : WARNING: $aSpaltepos: possibly used before declaration.
$tLayout = _GDIPlus_RectFCreate($aSpaltepos[1]+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(440,65) : WARNING: $aZeilePos: possibly used before declaration.
$tLayout = _GDIPlus_RectFCreate($aSpaltepos[1]+5, $aZeilePos[1]-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(462,100) : WARNING: $hHeaderline: possibly used before declaration.
_GDIPlus_GraphicsDrawLine($hBuffer_Header,0,$aZeilePos[1]-2,$GUI_Widh,$aZeilePos[1]-2,$hHeaderline)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(466,86) : WARNING: $hFont_Header_ueb: possibly used before declaration.
$aInfo = _GDIPlus_GraphicsMeasureString($hBuffer_Header, $sString, $hFont_Header_ueb,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(466,117) : WARNING: $hFormat_Header_ueb: possibly used before declaration.
$aInfo = _GDIPlus_GraphicsMeasureString($hBuffer_Header, $sString, $hFont_Header_ueb, $tLayout, $hFormat_Header_ueb)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(467,128) : WARNING: $hBrush_Header_ueb: possibly used before declaration.
_GDIPlus_GraphicsDrawStringEx($hBuffer_Header, $sString, $hFont_Header_ueb, $aInfo[0], $hFormat_Header_ueb, $hBrush_Header_ueb)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(479,53) : WARNING: $hBitmap_lines: possibly used before declaration.
_GDIPlus_GraphicsDrawImage($hBuffer, $hBitmap_lines,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(484,54) : WARNING: $hBitmap_Header: possibly used before declaration.
_GDIPlus_GraphicsDrawImage($hBuffer, $hBitmap_Header,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(489,39) : WARNING: $hGraphics: possibly used before declaration.
_GDIPlus_GraphicsDrawImage($hGraphics,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(489,49) : WARNING: $hBitmap: possibly used before declaration.
_GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(509,23) : WARNING: $AdlibRegister: possibly used before declaration.
If $AdlibRegister =
~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(524,35) : WARNING: $aZeilenID: possibly used before declaration.
For $i = 1 To UBound($aZeilenID)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(617,120) : WARNING: $FR_Brush_H: possibly used before declaration.
_GDIPlus_GraphicsFillRect($hGraphics,$aRectinfos[3],$aRectinfos[4],$aRectinfos[5],$aRectinfos[6],$FR_Brush_H)
~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(623,37) : WARNING: $aSpalteID: possibly used before declaration.
For $i = 3 To UBound($aSpalteID)
~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(629,121) : WARNING: $FR_V_Brush_H: possibly used before declaration.
_GDIPlus_GraphicsFillRect($hGraphics,$aRectinfos[3],$aRectinfos[4],$aRectinfos[5],$GUI_Height-200+20,$FR_V_Brush_H)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(908,49) : WARNING: $Spaltepos: possibly used before declaration.
$tLayout = _GDIPlus_RectFCreate($Spaltepos+
~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(914,57) : WARNING: $hBuffer_lines: possibly used before declaration.
$aInfo = _GDIPlus_GraphicsMeasureString($hBuffer_lines,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(942,37) : WARNING: $hFamily: possibly used before declaration.
_GDIPlus_FontFamilyDispose($hFamily)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(946,52) : WARNING: $hFamily_next_race_date: possibly used before declaration.
_GDIPlus_FontFamilyDispose($hFamily_next_race_date)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3(950,48) : WARNING: $hFamily_Header_ueb: possibly used before declaration.
_GDIPlus_FontFamilyDispose($hFamily_Header_ueb)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\MyHover.au3(10,24) : WARNING: $Leave_one: declared global in function only. Prefer top of file.
Global $Leave_one = 0
~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Matze\Documents\Alle AutiIT-Test\Formel 1\Script 2.au3 - 0 error(s), 47 warning(s)
Alles anzeigen
Das Scipt läuft natürlich, da alle Variablen vor der Benutzung Registriert werden, jedoch ist es sehr ärgerlich solch viele unnötigen Warnings zu erhalten, denn wenn an wirklich ein Fehler entsteht muss ich 50 mal F4 drücken bis ich zu dem eingentlichen Fehler komm.