MvGulik Posted January 11, 2013 Posted January 11, 2013 Aha. Roger. "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ...
UEZ Posted January 11, 2013 Author Posted January 11, 2013 I updated the code from post#1. Now you can see how it works. Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
UEZ Posted January 12, 2013 Author Posted January 12, 2013 (edited) I modified the code from post#1 slightly. Can somebody explain me why the recursion stack limit is reached when starting at coordinate 0,0 at $iRec = 13269 but when starting it with coordinate 82, 24 it will not break and $iRec is 28989. This is the result on my machine and may differ on yours. Thanks, UEZ Edited January 12, 2013 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
Developers Jos Posted January 12, 2013 Developers Posted January 12, 2013 (edited) The reason is that the recursion count with 0,0 hits 3900, which is the limit for x64 systems: Changed your debug a little to demonstrate it: expandcollapse popup#include <GDIPlus.au3> Global $recur = 1 $sRegPath = "HKLM\SOFTWARE\AutoIt v3\AutoIt" If StringInStr("X64IA64", @OSArch) Then $sRegPath = StringReplace($sRegPath, "SOFTWARE", "SOFTWARE\Wow6432Node") _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile(RegRead($sRegPath, "InstallDir") & "\Examples\GUI\logo4.gif") $iW = _GDIPlus_ImageGetWidth($hImage) $iH = _GDIPlus_ImageGetHeight($hImage) $hGUI = GUICreate("Test", $iW, $iH) GUISetState() $hGfx = _GDIPlus_GraphicsCreateFromHWND($hGUI) AdlibRegister("UpdateView", 10) $iColor2Fill = 0xFFFFFFFF _GDIPlus_FloodFill($hImage, 0, 0, 0xFF000080, 0xFFFFFF00) ;~ _GDIPlus_FloodFill($hImage, 82, 24, 0xFF000080, 0xFFFFFF00) _GDIPlus_ImageSaveToFile($hImage, @ScriptDir & "\Filled.png") ;~ ShellExecute(@ScriptDir & "\Filled.png") AdlibUnRegister("UpdateView") ConsoleWrite("Done" & @LF) Do Until GUIGetMsg() = -3 _GDIPlus_ImageDispose($hImage) _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_Shutdown() Exit Func _GDIPlus_FloodFill(ByRef $hBitmap, $iX, $iY, $iColorOld, $iColorNew) ;coded by UEZ 2013-01-11 Local Static $iRec = 1 ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $recur = ' & $recur & ' $iRec = ' & $iRec & ' >Error code: ' & @error & @CRLF) ;### Debug Console ;~ If $iRec > 13268 Then Return -1 ;max recursion stack reached Local $aResult = DllCall($ghGDIPDll, "uint", "GdipBitmapGetPixel", "handle", $hBitmap, "int", $iX, "int", $iY, "uint*", 0) If $aResult[4] = "0x" & Hex($iColorOld, 8) Then DllCall($ghGDIPDll, "uint", "GdipBitmapSetPixel", "handle", $hBitmap, "int", $iX, "int", $iY, "uint", $iColorNew) ;~ Sleep(10) Else Return 0 EndIf $iRec += 1 $aResult = DllCall($ghGDIPDll, "uint", "GdipGetImageDimension", "handle", $hBitmap, "float*", 0, "float*", 0) If ($iX + 1) < $aResult[2] + 1 Then $iRec += 1 $recur += 1 _GDIPlus_FloodFill($hBitmap, $iX + 1, $iY, $iColorOld, $iColorNew) ;go east $recur -= 1 EndIf If ($iY + 1) < $aResult[3] + 1 Then $iRec += 1 $recur += 1 _GDIPlus_FloodFill($hBitmap, $iX, $iY + 1, $iColorOld, $iColorNew) ;go south $recur -= 1 EndIf If ($iX - 1) > -1 Then $iRec += 1 $recur += 1 _GDIPlus_FloodFill($hBitmap, $iX - 1, $iY, $iColorOld, $iColorNew) ;go west $recur -= 1 EndIf If ($iY - 1) > -1 Then $iRec += 1 $recur += 1 _GDIPlus_FloodFill($hBitmap, $iX, $iY - 1, $iColorOld, $iColorNew) ;go north $recur -= 1 EndIf Return 1 EndFunc ;==>_GDIPlus_FloodFill Func UpdateView() _GDIPlus_GraphicsDrawImage($hGfx, $hImage, 0, 0) EndFunc ;==>UpdateView Jos Edited January 12, 2013 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
UEZ Posted January 12, 2013 Author Posted January 12, 2013 (edited) Thanks for the clarification Jos. That means the stack will be decreased when returning from the function. That was a misunderstanding from me. $iRec is the sum of recursion calls not the recursion level. Br, UEZ Edited January 13, 2013 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
Developers Jos Posted January 12, 2013 Developers Posted January 12, 2013 Maybe trancexx or Jon can comment here, but looking at the source it seems we have a 3900 limit for x64 and a 1900 limit for x86 for both Call and Execute while the helpfile states 5100. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
James Posted January 12, 2013 Posted January 12, 2013 Stack-based recursion is awesome. I had to do something similar in node.js a few months ago, like monoceres pointed out, visualizing the output from it is cool Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
UEZ Posted January 12, 2013 Author Posted January 12, 2013 Here the iterative version which is much slower because I used an array for the stack simulation: expandcollapse popup#include <Array.au3> #include <GDIPlus.au3>;~~~ $sRegPath = "HKLM\SOFTWARE\AutoIt v3\AutoIt" If StringInStr("X64IA64", @OSArch) Then $sRegPath = StringReplace($sRegPath, "SOFTWARE", "SOFTWARE\Wow6432Node") _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile(RegRead($sRegPath, "InstallDir") & "\Examples\GUI\logo4.gif") $iW = _GDIPlus_ImageGetWidth($hImage) $iH = _GDIPlus_ImageGetHeight($hImage) $hGUI = GUICreate("Test", $iW, $iH) GUISetState() $hGfx = _GDIPlus_GraphicsCreateFromHWND($hGUI) AdlibRegister("UpdateView", 10) $iColor2Fill = 0xFFFFFFFF ;~ _GDIPlus_FloodFillRecRec($hImage, 0, 0, 0xFF000080, 0xFFFFFF00) _GDIPlus_FloodFillRecIter($hImage, 0, 0, 0xFF000080, 0xFFFFFF00) _GDIPlus_ImageSaveToFile($hImage, @ScriptDir & "\Filled.gif") ;~ ShellExecute(@ScriptDir & "\Filled.png") AdlibUnRegister("UpdateView") ConsoleWrite("Done" & @LF) Do Until GUIGetMsg() = -3 _GDIPlus_ImageDispose($hImage) _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_Shutdown() Exit Func _GDIPlus_FloodFillRecIter(ByRef $hBitmap, $iX, $iY, $iColorOld, $iColorNew) ;coded by UEZ 2013-01-12 Local $aResult = DllCall($ghGDIPDll, "uint", "GdipGetImageDimension", "handle", $hBitmap, "float*", 0, "float*", 0) Local $iW = $aResult[2], $iH = $aResult[3] If BitOR($iX < 0, $iY < 0, $iX > $iW - 1, $iY > $iH - 1) Then Return 0 EndIf Local $x, $y Local $aStack[1] ;stack ->x,y coordinate _ArrayAdd($aStack, $iX & ";" & $iY) While UBound($aStack) > 1 $sPoint = $aStack[UBound($aStack) - 1] _ArrayDelete($aStack, UBound($aStack) - 1) ;pop $x = Int(StringRegExpReplace($sPoint, "(\d+);\d+", "$1")) $y = Int(StringRegExpReplace($sPoint, "\d+;(\d+)", "$1")) If BitOR($x< 0, $y < 0, $x > $iW - 1, $y > $iH - 1) Then ContinueLoop $aResult = DllCall($ghGDIPDll, "uint", "GdipBitmapGetPixel", "handle", $hBitmap, "int", $x, "int", $y, "uint*", 0) If $aResult[4] = "0x" & Hex($iColorOld, 8) Then DllCall($ghGDIPDll, "uint", "GdipBitmapSetPixel", "handle", $hBitmap, "int", $x, "int", $y, "uint", $iColorNew) _ArrayAdd($aStack, $x + 1 & ";" & $y) ;push _ArrayAdd($aStack, $x & ";" & $y + 1) ;push _ArrayAdd($aStack, $x - 1 & ";" & $y) ;push _ArrayAdd($aStack, $x & ";" & $y - 1) ;push EndIf WEnd EndFunc Func _GDIPlus_FloodFillRec(ByRef $hBitmap, $iX, $iY, $iColorOld, $iColorNew) ;coded by UEZ 2013-01-12 Local Static $iRec = 1 If $iRec = 3898 Then ConsoleWrite("max recursion level has been reached" & @LF) Return -1 ;max recursion level has been reached EndIf Local $aResult = DllCall($ghGDIPDll, "uint", "GdipBitmapGetPixel", "handle", $hBitmap, "int", $iX, "int", $iY, "uint*", 0) If $aResult[4] = "0x" & Hex($iColorOld, 8) Then DllCall($ghGDIPDll, "uint", "GdipBitmapSetPixel", "handle", $hBitmap, "int", $iX, "int", $iY, "uint", $iColorNew) Else Return 0 EndIf $aResult = DllCall($ghGDIPDll, "uint", "GdipGetImageDimension", "handle", $hBitmap, "float*", 0, "float*", 0) If ($iX + 1) < $aResult[2] + 1 Then $iRec += 1 _GDIPlus_FloodFillRec($hBitmap, $iX + 1, $iY, $iColorOld, $iColorNew) ;go east $iRec -= 1 EndIf If ($iY + 1) < $aResult[3] + 1 Then $iRec += 1 _GDIPlus_FloodFillRec($hBitmap, $iX, $iY + 1, $iColorOld, $iColorNew) ;go south $iRec -= 1 EndIf If ($iX - 1) > -1 Then $iRec += 1 _GDIPlus_FloodFillRec($hBitmap, $iX - 1, $iY, $iColorOld, $iColorNew) ;go west $iRec -= 1 EndIf If ($iY - 1) > -1 Then $iRec += 1 _GDIPlus_FloodFillRec($hBitmap, $iX, $iY - 1, $iColorOld, $iColorNew) ;go north $iRec -= 1 EndIf Return 1 EndFunc Func UpdateView() _GDIPlus_GraphicsDrawImage($hGfx, $hImage, 0, 0) EndFunc Searching for a much faster stack simulation code! Btw, how can I use AutoIt objects to do some p.x or p.y to read/write it? Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
KaFu Posted January 12, 2013 Posted January 12, 2013 (edited) Use a dictionary object, much faster than an array. Alternatively do not use the Array UDF functions, as they redim the array on each call. Redim the array only every 500 or 1000 elements and perform the additions and deletions manually with an own counter... but I still would first try the dictionary object ... Edit: Wasn't there something with vtables in the last beta? Wouldn't this be a good application for those? Edited January 12, 2013 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
Developers Jos Posted January 12, 2013 Developers Posted January 12, 2013 Try this one... its a little faster expandcollapse popup#include <Array.au3> #include <GDIPlus.au3>;~~~ $sRegPath = "HKLM\SOFTWARE\AutoIt v3\AutoIt" If StringInStr("X64IA64", @OSArch) Then $sRegPath = StringReplace($sRegPath, "SOFTWARE", "SOFTWARE\Wow6432Node") _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile(RegRead($sRegPath, "InstallDir") & "\Examples\GUI\logo4.gif") $iW = _GDIPlus_ImageGetWidth($hImage) $iH = _GDIPlus_ImageGetHeight($hImage) $hGUI = GUICreate("Test", $iW, $iH) GUISetState() $hGfx = _GDIPlus_GraphicsCreateFromHWND($hGUI) AdlibRegister("UpdateView", 10) $iColor2Fill = 0xFFFFFFFF ;~ _GDIPlus_FloodFillRecRec($hImage, 0, 0, 0xFF000080, 0xFFFFFF00) _GDIPlus_FloodFillRecIter($hImage, 0, 0, 0xFF000080, 0xFFFFFF00) _GDIPlus_ImageSaveToFile($hImage, @ScriptDir & "\Filled.gif") ;~ ShellExecute(@ScriptDir & "\Filled.png") AdlibUnRegister("UpdateView") ConsoleWrite("Done" & @LF) Do Until GUIGetMsg() = -3 _GDIPlus_ImageDispose($hImage) _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_Shutdown() Exit Func _GDIPlus_FloodFillRecIter(ByRef $hBitmap, $iX, $iY, $iColorOld, $iColorNew) ;coded by UEZ 2013-01-12 Local $aResult = DllCall($ghGDIPDll, "uint", "GdipGetImageDimension", "handle", $hBitmap, "float*", 0, "float*", 0) Local $iW = $aResult[2], $iH = $aResult[3] If BitOR($iX < 0, $iY < 0, $iX > $iW - 1, $iY > $iH - 1) Then Return 0 EndIf Local $x, $y Local $aStack[5000] ;stack ->x,y coordinate Local $iStack = 1 StackAdd($aStack, $iX & ";" & $iY, $iStack) While $iStack > 0 $sPoint = $aStack[$iStack - 1] StackDelete($aStack, $iStack) ;pop $x = Int(StringRegExpReplace($sPoint, "(\d+);\d+", "$1")) $y = Int(StringRegExpReplace($sPoint, "\d+;(\d+)", "$1")) If BitOR($x< 0, $y < 0, $x > $iW - 1, $y > $iH - 1) Then ContinueLoop $aResult = DllCall($ghGDIPDll, "uint", "GdipBitmapGetPixel", "handle", $hBitmap, "int", $x, "int", $y, "uint*", 0) If $aResult[4] = "0x" & Hex($iColorOld, 8) Then DllCall($ghGDIPDll, "uint", "GdipBitmapSetPixel", "handle", $hBitmap, "int", $x, "int", $y, "uint", $iColorNew) StackAdd($aStack, $x + 1 & ";" & $y, $iStack) ;push StackAdd($aStack, $x & ";" & $y + 1, $iStack) ;push StackAdd($aStack, $x - 1 & ";" & $y, $iStack) ;push StackAdd($aStack, $x & ";" & $y - 1, $iStack) ;push EndIf WEnd EndFunc Func _GDIPlus_FloodFillRec(ByRef $hBitmap, $iX, $iY, $iColorOld, $iColorNew) ;coded by UEZ 2013-01-12 Local Static $iRec = 1 If $iRec = 3898 Then ConsoleWrite("max recursion level has been reached" & @LF) Return -1 ;max recursion level has been reached EndIf Local $aResult = DllCall($ghGDIPDll, "uint", "GdipBitmapGetPixel", "handle", $hBitmap, "int", $iX, "int", $iY, "uint*", 0) If $aResult[4] = "0x" & Hex($iColorOld, 8) Then DllCall($ghGDIPDll, "uint", "GdipBitmapSetPixel", "handle", $hBitmap, "int", $iX, "int", $iY, "uint", $iColorNew) Else Return 0 EndIf $aResult = DllCall($ghGDIPDll, "uint", "GdipGetImageDimension", "handle", $hBitmap, "float*", 0, "float*", 0) If ($iX + 1) < $aResult[2] + 1 Then $iRec += 1 _GDIPlus_FloodFillRec($hBitmap, $iX + 1, $iY, $iColorOld, $iColorNew) ;go east $iRec -= 1 EndIf If ($iY + 1) < $aResult[3] + 1 Then $iRec += 1 _GDIPlus_FloodFillRec($hBitmap, $iX, $iY + 1, $iColorOld, $iColorNew) ;go south $iRec -= 1 EndIf If ($iX - 1) > -1 Then $iRec += 1 _GDIPlus_FloodFillRec($hBitmap, $iX - 1, $iY, $iColorOld, $iColorNew) ;go west $iRec -= 1 EndIf If ($iY - 1) > -1 Then $iRec += 1 _GDIPlus_FloodFillRec($hBitmap, $iX, $iY - 1, $iColorOld, $iColorNew) ;go north $iRec -= 1 EndIf Return 1 EndFunc Func UpdateView() _GDIPlus_GraphicsDrawImage($hGfx, $hImage, 0, 0) EndFunc ; Func StackAdd(Byref $aStack, $SVal,ByRef $iStack) If $iStack+2 > UBound($aStack) then ReDim $aStack[$iStack+500] $aStack[$iStack] = $SVal $iStack += 1 EndFunc ; Func StackDelete(ByRef $aStack,Byref $iStack) $iStack -= 1 EndFunc SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
UEZ Posted January 12, 2013 Author Posted January 12, 2013 Thanks guys! Currently I was doing also some tuning for the stack implementation but the array was implemented just to test whether it will work or not. One of my ideas was also to use dictionary object as suggested by KaFu. Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
UEZ Posted January 13, 2013 Author Posted January 13, 2013 Here the Scripting Dictionary iterative version expandcollapse popup#include <GDIPlus.au3> $sRegPath = "HKLM\SOFTWARE\AutoIt v3\AutoIt" If StringInStr("X64IA64", @OSArch) Then $sRegPath = StringReplace($sRegPath, "SOFTWARE", "SOFTWARE\Wow6432Node") _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile(RegRead($sRegPath, "InstallDir") & "\Examples\GUI\logo4.gif") $iW = _GDIPlus_ImageGetWidth($hImage) $iH = _GDIPlus_ImageGetHeight($hImage) $hGUI = GUICreate("Test", $iW, $iH) GUISetState() $hGfx = _GDIPlus_GraphicsCreateFromHWND($hGUI) AdlibRegister("UpdateView", 10) $iColor2Fill = 0xFFFFFFFF _GDIPlus_FloodFillIter2($hImage, 0, 0, 0xFF000080, 0xFFFFFF00) _GDIPlus_ImageSaveToFile($hImage, @ScriptDir & "\Filled.png") ;~ ShellExecute(@ScriptDir & "\Filled.png") AdlibUnRegister("UpdateView") ConsoleWrite("Done" & @LF) Do Until GUIGetMsg() = -3 _GDIPlus_ImageDispose($hImage) _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_Shutdown() Exit Func _GDIPlus_FloodFillIter2(ByRef $hBitmap, $iX, $iY, $iColorOld, $iColorNew) ;coded by UEZ 2013-01-13 Local $aResult = DllCall($ghGDIPDll, "uint", "GdipGetImageDimension", "handle", $hBitmap, "float*", 0, "float*", 0) Local $iW = $aResult[2], $iH = $aResult[3] If BitOR($iX < 0, $iY < 0, $iX > $iW - 1, $iY > $iH - 1) Then Return SetError(1, 0, 0) Local $x, $y, $i = 1 Local $oD = ObjCreate('Scripting.Dictionary') $oD.Add($i, $iX & ";" & $iY) ;push $i += 1 While $oD.Count > 0 $sPoint = $oD.Item($i - 1) $oD.Remove($i - 1) ;pop $i -= 1 $x = Int(StringRegExpReplace($sPoint, "(\d+);\d+", "$1")) $y = Int(StringRegExpReplace($sPoint, "\d+;(\d+)", "$1")) If BitOR($x < 0, $y < 0, $x > $iW - 1, $y > $iH - 1) Then ContinueLoop $aResult = DllCall($ghGDIPDll, "uint", "GdipBitmapGetPixel", "handle", $hBitmap, "int", $x, "int", $y, "uint*", 0) If $aResult[4] = "0x" & Hex($iColorOld, 8) Then DllCall($ghGDIPDll, "uint", "GdipBitmapSetPixel", "handle", $hBitmap, "int", $x, "int", $y, "uint", $iColorNew) $oD.Add($i, $x + 1 & ";" & $y) ;push $i += 1 $oD.Add($i, $x & ";" & $y + 1) ;push $i += 1 $oD.Add($i, $x - 1 & ";" & $y) ;push $i += 1 $oD.Add($i, $x & ";" & $y - 1) ;push $i += 1 EndIf WEnd $oD = 0 Return 1 EndFunc ;==>_GDIPlus_FloodFillIter2 Func UpdateView() _GDIPlus_GraphicsDrawImage($hGfx, $hImage, 0, 0) EndFunc @Jos: While $iStack > 0 must be While $iStack > 1, otherwise flooding will continue at 0, 0. Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
KaFu Posted January 13, 2013 Posted January 13, 2013 Now, well done, seems fast enough for me . OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
Administrators Jon Posted January 13, 2013 Administrators Posted January 13, 2013 Maybe trancexx or Jon can comment here, but looking at the source it seems we have a 3900 limit for x64 and a 1900 limit for x86 for both Call and Execute while the helpfile states 5100.JosIt changes each version. I didn't even know it was in the helpfile. It should probably be removed.
guinness Posted January 13, 2013 Posted January 13, 2013 It changes each version. I didn't even know it was in the helpfile. It should probably be removed.Do I remove it? UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
Mat Posted January 14, 2013 Posted January 14, 2013 Do I remove it?Might be worth keeping a note that there is a recursion limit. It's one of those gotchas for people who haven't programmed before that still comes up as a question from time to time. AutoIt Project Listing
guinness Posted January 14, 2013 Posted January 14, 2013 But how to word it so it doesn't raise questions of: What is the limit? UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
Mat Posted January 14, 2013 Posted January 14, 2013 But how to word it so it doesn't raise questions of: What is the limit?When you call a function, an entry ("frame") is added to the call stack. Further nested function calls add to this stack and returning from a function removes its entry. The call stack has a fixed size, which depends on the version of AutoIt being run, but is made large enough that it should only be overflowed by very deep or infinite recursion. If a function is likely to call itself more than 1000 times then you should switch to an iterative method (one involving loops).That's a very rough attempt. Does have to give some sort of reference to the stack size being in the order of a thousand. AutoIt Project Listing
jchd Posted January 14, 2013 Posted January 14, 2013 (edited) I can't say. If the call stack is direct and fixed size, the limit should strongly depend on the number, type and size of parameters pushed at each round. If the stack is indirect, then merely depends on 32- vs 64-bit and release (but in this case it's questionable that a recursion limit even exists, beside process memory exhausted). Only devs can say for sure. In the later case, maybe a simple runable script made available online would avoid too many "how much" questions, so that users can actually determine themselves which is the limit for the installation they use. If the former style is in fact in use, then users would have to try by themselves with the exact function prototype they use in their real-world application. All of this provided that OnAutoItExitRegister can actually run a function which prints a variable, which is far from obvious in case of stack overflow. But using ConsoleWrite can overcome the issue, as we're not talking about billion recursions/lines. Can't test that from where I am currently. Edited January 14, 2013 by jchd This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
AZJIO Posted January 14, 2013 Posted January 14, 2013 Can't test that from where I am currently._FuncName() Func _FuncName($F = True, $L=0) MsgBox(0, 'Level', $L) If Not $F Then Return If $L = 5 Then $F = False _FuncName($F, $L+1) EndFunc My other projects or all
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