Da steht aber noch die 4?
mit "IF" Funktion mehrere Variablen ansprechen
-
AlphavibeZ -
31. Januar 2018 um 19:17 -
Erledigt
-
-
Ja, habs nochmal damit versucht
Hab jetzt nochmal nur [] [2] geschrieben und jetzt läufts! super, tausend dank!
Jetzt wär ich wieder beim urpsrungsproblem :
Ich habe mir gedacht, dass ich jetzt noch eine 3 Spalte in das Array einfügen kann und den Wert dieser Spalte später in das Webformular übertragen. Sollte doch eigentlich funktionieren oder? Die Frage ist bloß, wie hol ich mir jetzt den Wert aus der 3ten Spalte des arrays?
-
Na wie wohl, du greifst auf die dritte Spalte zu $aHersteller[0][2].
-
Habe grade versucht die 3 Spalte einzufügen, aber dann bekomme ich wieder den Fehler
"Array variable has incorrect number of subscripts or subscript dimension range exceeded."
sieht so bei mir aus, da müsste doch eigentlich die 3te spalte problemlos funktionieren, oder?
Global $aHersteller[][3]
-
Poste mal mit Einträgen bitte.
-
Code
Alles anzeigenGlobal $aHersteller[][] = [ _ ["Albert" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_361&action=new_product" , "46"], _ ["Anta" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_359&action=new_product" , "73"], _ ["Artemide" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_360&action=new_product" , "17"], _ ["B+M Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_362&action=new_product" ,"32"], _ ["BM Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_362&action=new_product" , "32"], _ ["B-Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_364&action=new_product" , "80"], _ ["Bankamp" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_363&action=new_product" , "84"], _ ["Basis Design" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_372&action=new_product" , "70"], _ ["Bega" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_373&action=new_product" , "41"], _ ["Bega Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_373&action=new_product" , "41"], _ ["Blomus" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_421&action=new_product" , "30"], _ ["Blux" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_365&action=new_product" , ""], _ ["Böhmer Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_369&action=new_product" , "1"], _ ["Böhmer" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_369&action=new_product" , "1"], _ ["Bopp Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_418&action=new_product" , "87"], _ ["Bopp" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_418&action=new_product" , "87"], _ ["Brilliant" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_368&action=new_product" , "82"], _ ["Bruck Design" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_366&action=new_product" , "91"], _ ["Bruck" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_366&action=new_product" , "91"], _ ["BTR" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_367&action=new_product" , "86"], _ ["btr" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_367&action=new_product" , "54"], _ ["Casablanca Design" , "https://www.wohnkult24.com/admin/categories.php?cPath=370_362&action=new_product" , ""], _ ["CMD" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_379&action=new_product" , ""], _ ["Delta Light" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_392&action=new_product" , ""], _ ["Eglo" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_424&action=new_product" , ""], _ ["Escale" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_375&action=new_product" , ""], _ ["Evotec" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_530&action=new_product" , ""], _ ["Fabas Luce" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_434&action=new_product" , ""], _ ["Fischer m6 Systeme" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_405&action=new_product" , ""], _ ["Fischer Shine" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_380&action=new_product" , ""], _ ["GKS Knapstein" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_460&action=new_product" , ""], _ ["GKS" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_460&action=new_product" , ""], _ ["Knapstein" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_460&action=new_product" , ""], _ ["GKS - Knapstein" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_460&action=new_product" , ""], _ ["Grossmann" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_387&action=new_product" , ""], _ ["Helestra" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_389&action=new_product" , ""], _ ["Holtkötter" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_385&action=new_product" , ""], _ ["Honsel" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_382&action=new_product" , ""], _ ["Honsel Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_382&action=new_product" , ""], _ ["Hufnagel" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_438&action=new_product" , ""], _ ["Icone" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_440&action=new_product" , ""], _ ["Ingo Maurer" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_435&action=new_product" , ""], _ ["IP44 Design" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_439&action=new_product" , ""], _ ["Kundalini" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_384&action=new_product" , ""], _ ["LCD" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_423&action=new_product" , ""], _ ["Leuchtendirekt" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_532&action=new_product" , ""], _ ["Limburg" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_374&action=new_product" , ""], _ ["Limburg Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_374&action=new_product" , ""], _ ["Lucelab" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_432&action=new_product" , ""], _ ["Lucide" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_377&action=new_product" , ""], _ ["Lutec" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_383&action=new_product" , ""], _ ["Milan" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_394&action=new_product" , ""], _ ["Nemo" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_433&action=new_product" , ""], _ ["Nordlux" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_388&action=new_product" , ""], _ ["Oligo" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_376&action=new_product" , "", _ ["Philips" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_390&action=new_product" , ""], _ ["Rösle" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_441&action=new_product" , ""], _ ["Serien Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_416&action=new_product" , ""], _ ["Slamp" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_386&action=new_product" , ""], _ ["SLV" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_462&action=new_product" , ""], _ ["Studio Italia Design" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_436&action=new_product" , ""], _ ["Trio Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_391&action=new_product" , ""], _ ["Vibia" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_393&action=new_product" , ""], _ ["Wofi Action" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_430&action=new_product" , ""], _ ["Wofi Leuchten", "https://www.wohnkult24.com/admin/categories.php?cPath=356_429&action=new_product" , ""] ] For $i = 0 To UBound($aHersteller) - 1 If $s_hersteller = $aHersteller[$i][0] Then _IENavigate($oIE, $aHersteller[$i][1]) EndIf Next
bin grad noch am werte eintragen , sollte aber trotzdem funktionieren
-
Ja, so sollte das eigentlich problemlos klappen wenn du auf den [2] Spaltenindex zugreifst.
-
Funktioniert nur leider nicht
bekomme leider die ganze zeit diesen error
-
In der Zeile :
["Oligo" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_376&action=new_product" , "", _
fehlt hinten eine Klammer. Korrekt wäre :
["Oligo" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_376&action=new_product" , ""], _
-
In der Zeile :
["Oligo" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_376&action=new_product" , "", _
fehlt hinten eine Klammer. Korrekt wäre :
["Oligo" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_376&action=new_product" , ""], _
Augen wie ein Luchs. Bin beeindruckt. Vielen Dank!
€:
Habe es nun auch hinbekommen, die Daten zu holen und es funktioniert alles. Vielen Dank für alles Leute!!!
-
Setze einfach mal ein :
#include <Array.au3>
an den Anfang des Skriptes, und nach der Besetzung der Arrayelemente die Zeile :
_ArrayDisplay($aHersteller)
Dann bekommst Du die Werte angezeigt.
Gruß Musashi
-
Setze einfach mal ein :
#include <Array.au3>
an den Anfang des Skriptes, und nach der Besetzung der Arrayelemente die Zeile :
_ArrayDisplay($aHersteller)
Dann bekommst Du die Werte angezeigt.
Gruß Musashi
danke, das hilft mir bei der kontrolle :)! habe mein ziel erreicht für heute, morgen gehts weiter. Da haben sich die 14 stunden heute gelohnt. Schönen Abend euch!
-
Hallo AlphavibeZ !
Tipp :
Bisher trägst Du die Daten des Herstellerarrays im Quellcode selbst ein. Das macht Änderungen unnötig aufwändig, da Du immer den Code neu 'kompilieren' musst.
Besser wäre es, die Daten z.B. in einer Textdatei zu speichern und dort zu editieren/erweitern.
(Die Pflege der Daten in z.B. Excel mit anschließendem .csv-Export oder Direktzugriff, wären auch denkbar)
Hier ein einfaches Anschauungsbeispiel :
- deine Herstellerdaten aus Beitrag #26 befinden sich in der Datei ''ArrayData.txt" (siehe Anhang)
- diese Datei in das Skriptverzeichnis kopieren
Das Programm ist nun erheblich kürzer :
AutoIt
Alles anzeigen#include <File.au3> #include <Array.au3> Global $sFilePath = @ScriptDir & "\ArrayData.txt" Global $aDataArray ; Array aus 'ArrayData.txt' einlesen , Feldtrennzeichen = | : _FileReadToArray($sFilePath, $aDataArray, $FRTA_NOCOUNT, "|") ; Array anzeigen : _ArrayDisplay($aDataArray, "Array aus ArrayData.txt")
Gruß Musashi
-
Funktioniert super. Danke für die Mühe!
-