foster74 Posted April 17, 2009 Posted April 17, 2009 (edited) It will have over 20 for loops, anyway to make it simple? I can not think of anything =( For $i1 = 1 to $ArrayLINKS[0] _IENavigate($oIE, $ArrayLINKS[$i1]) $ArrayLINKS1 = _GetLinks() $ArraySIZES1 = _GetSize() If $ArrayLINKS1[0] > 0 Then ;;; For $i2 = 1 to $ArrayLINKS1[0] _IENavigate($oIE, $ArrayLINKS1[$i2]) $ArrayLINKS2 = _GetLinks() $ArraySIZES2 = _GetSize() If $ArrayLINKS2[0] > 0 Then ;;; For $i3 = 1 to $ArrayLINKS2[0] _IENavigate($oIE, $ArrayLINKS2[$i3]) $ArrayLINKS3 = _GetLinks() $ArraySIZES3 = _GetSize() If $ArrayLINKS3[0] > 0 Then ;;; EndIf _Collect($ArraySIZES2[$i3]) Next ;;; EndIf _Collect($ArraySIZES1[$i2]) Next ;;; EndIf _Collect($ArraySIZES[$i1]) Next edit: typo Edited April 17, 2009 by foster74
andybiochem Posted April 17, 2009 Posted April 17, 2009 This might work:...untested of course - posting a working script is easier to debug etcFor $i = 0 to 19;this will loop 20 times If $i = 0 Then $i = "" For $j = 1 to Execute("$ArrayLINKS" & $i & "[0]") _IENavigate($oIE, Execute("$ArrayLINKS" & $i & "[" & $j & "]") Assign("ArrayLINKS" & $i + 1,_GetLinks()) Assign("ArraySIZES" & $i + 1,_GetSize()) _Collect(Execute("$ArraySIZES" & $i & "[" & $j & "]")) If Execute("$ArrayLINKS" & $i + 1 & "[0]") = 0 Then ExitLoop 2 Next NextYou will get a LOT of "$var is not declared" errors using Execute() and Assign(), so make sure you have declared all your vars and arrays somewhere beforehand. - Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!
WideBoyDixon Posted April 17, 2009 Posted April 17, 2009 There certainly is! However, you'll need to delve in to the depths of recursion and AFAIR, AutoIt isn't fantastically well suited to recursion. Google is your friend here or search the forums for recursive functions. WBD [center]Wide by name, Wide by nature and Wide by girth[u]Scripts[/u]{Hot Folders} {Screen Calipers} {Screen Crosshairs} {Cross-Process Subclassing} {GDI+ Clock} {ASCII Art Signatures}{Another GDI+ Clock} {Desktop Goldfish} {Game of Life} {3D Pie Chart} {Stock Tracker}[u]UDFs[/u]{_FileReplaceText} {_ArrayCompare} {_ToBase}~ My Scripts On Google Code ~[/center]
WideBoyDixon Posted April 17, 2009 Posted April 17, 2009 Could take forever to run ... I hope _GetLinks() doesn't follow off-site links! Something like this perhaps? Func _FollowAllLinks() Local $aLinks = _GetLinks(), $aSizes = _GetSize(), $i If $aLinks[0] > 0 Then For $i = 1 To $aLinks[0] _IENavigate($oIE, $aLinks[$i]) _FollowAllLinks() _Collect($aSizes[$i]) Next EndIf EndFunc WBD [center]Wide by name, Wide by nature and Wide by girth[u]Scripts[/u]{Hot Folders} {Screen Calipers} {Screen Crosshairs} {Cross-Process Subclassing} {GDI+ Clock} {ASCII Art Signatures}{Another GDI+ Clock} {Desktop Goldfish} {Game of Life} {3D Pie Chart} {Stock Tracker}[u]UDFs[/u]{_FileReplaceText} {_ArrayCompare} {_ToBase}~ My Scripts On Google Code ~[/center]
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