Auswerten von _FFLinksGetAll in der FF.au3

  • Hey Leute,

    ich habe folgendes Problem: Ich will mit _FFLinksGetAll alle Links einer Seite mir anzeigen lassen. Das funktioniert auch soweit, jedoch wenn ich die einzelnen Arrays in einen String umwandeln will, wird mir nichts mehr angezeigt sozusagen.

    Spoiler anzeigen
    [autoit]


    $input = InputBox ("Seite zum parsen","URLt")
    _FFStart ($input,"default",2,False)
    _FFWindowClose () ;wegen dem 2424 fenster da^^
    $links = _FFLinksGetAll ()
    _ArrayDisplay ($links) ;funktioniert wunderbar
    For $i = 0 to 9
    $string = _ArrayToString ($links[79][$i])
    MsgBox (16,"",$string) ;gibt nichts aus
    Next

    [/autoit]

    Hier noch die Funktion aus der FF.au3:

    Spoiler anzeigen
    [autoit]

    ; #FUNCTION# ===================================================================
    ; Name ..........: _FFLinksGetAll
    ; Description ...: Returns an array with informations about all existing links.
    ; Beschreibung ..: Gibt ein Array mit Informationen über alle vorhandenen Links zurück.
    ; AutoIt Version : V3.3.0.0
    ; Syntax ........: _FFLinksGetAll()
    ; Parameter(s): .:
    ; Return Value ..: Success - 2 dim array with the link informations:
    ; | array[n][0] = href
    ; | array[n][1] = hash
    ; | array[n][2] = search
    ; | array[n][3] = name
    ; | array[n][4] = id
    ; | array[n][5] = text
    ; | array[n][6] = innerHTML
    ; | array[n][7] = target
    ; | array[n][8] = protocol
    ; | array[n][9] = port
    ; Failure - array[0][0] = 0
    ; @ERROR -
    ; Author(s) .....: Thorsten Willert
    ; Date ..........: Tue Sep 22 12:00:34 CEST 2009 @458 /Internet Time/
    ; Link ..........:
    ; Related .......:
    ; Example .......: Yes
    ; ==============================================================================
    Func _FFLinksGetAll()
    Local Const $sFuncName = "_FFLinksGetAll"

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

    Local $aInfo, $sInfo, $aRet[1][9], $aTmp
    Local $sDelimiter

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

    Local $bTrc = $_FF_COM_TRACE
    $_FF_COM_TRACE = False

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

    If _FFGetLength() > 0 Then
    $sDelimiter = "FF" & Random(1000, 9999, 1)
    $sInfo = _FFCmd('FFau3.GetLinks("' & $sDelimiter & '");')
    $aInfo = StringSplit($sInfo, @CRLF)
    If @error Then
    $_FF_COM_TRACE = $bTrc
    SetError(__FFError($sFuncName, $_FF_ERROR_NoMatch))
    Return $aRet[0][0] = 0
    EndIf
    ReDim $aRet[$aInfo[0] - 1][9]
    For $i = 1 To $aInfo[0] - 1
    $aTmp = StringSplit($aInfo[$i], $sDelimiter, 1)
    If @error Then
    SetError(__FFError($sFuncName, $_FF_ERROR_RetValue, "StringSplit: " & $aInfo[$i]))
    ExitLoop
    EndIf
    If UBound($aTmp) <> 11 Then
    $sDelimiter = "FF" & Random(1000, 9999, 1)
    $sInfo = _FFCmd("FFau3.GetLinkInfo(" & $i & " ,'top','" & $sDelimiter & "')")
    $aTmp = StringSplit($sInfo, $sDelimiter, 1)
    EndIf
    For $j = 1 To $aTmp[0] - 1
    $aRet[$i - 1][$j - 1] = $aTmp[$j]
    Next
    Next
    $_FF_COM_TRACE = $bTrc
    Return $aRet
    Else
    SetError(__FFError($sFuncName, $_FF_ERROR_NoMatch))
    $aRet[0][0] = 0
    EndIf

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

    $_FF_COM_TRACE = $bTrc
    SetError(__FFError($sFuncName, $_FF_ERROR_GeneralError))
    Return $aRet[0][0] = 0
    EndFunc ;==>_FFLinksGetAll

    [/autoit]

    Außerdem gibt mir die Konsole noch aus:

    Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
    $string = _ArrayToString ($links[79][$i],"")
    $string = _ArrayToString (^ ERROR


    Aber in der Funktion steht doch ganz klar drin, dass ein 2-dimensionales Array erstellt wird?!

    Danke :)

    Liebe Grüße

    Einmal editiert, zuletzt von Manlius (26. Februar 2012 um 01:48)

  • Die korrekte Syntax für _ArrayToString wäre

    [autoit]

    _ArrayToString ($links)

    [/autoit]


    Aber _ArrayToString kann nur 1 dimensionale Arrays bearbeiten

    Hier wäre noch was für 2d Arrays
    2DArraytoString