1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. gmmg

Beiträge von gmmg

  • eingebettetes Excel aktivieren

    • gmmg
    • 4. Februar 2014 um 15:25

    hast du einfach mal einen mausklick probiert?

    MouseClick ( "button" [, x, y [, clicks [, speed]]] )

    gruß gmmg

  • Datum in Integer8 (AD accountExpires)

    • gmmg
    • 4. Februar 2014 um 15:22

    Masterofdwc

    hab da grad ein vbs script bei mir gefunden ... eventuell hilft dir das weiter ...

    Spoiler anzeigen
    [autoit]


    'http://www.selfadsi.de/deep-inside/microsoft-integer8-attributes.htm

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

    'hier müssen Sie einen Distinguished Name eines Benutzers Ihrer eigenen Umgebung einsetzen!
    'Set obj = GetObject("LDAP://cn=Administrator,cn=Users,dc=cerrotorre,dc=de")

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

    'llValue = obj.GetEx("lastLogonTimeStamp")
    'nicht vergessen: GetEx gibt stets ein Array zurück!
    'WScript.Echo LargeIntegerToDate(llValue(0))

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

    'zeigt den Integer8 Wert des aktuellen Datums+Uhrzeit...
    'WScript.Echo
    DateToLargeIntegerString(Now)

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

    Function LargeIntegerToDate(value)
    'nimmmt einen Microsoft LargeInteger Wert (Integer8) und gibt das entsprechende Datum plus Uhrzeit zurück

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

    'erst die lokale Zeitabweichung aus der Registry auslesen
    Set sho = CreateObject("Wscript.Shell")
    timeShiftValue = sho.RegRead("HKLM\System\CurrentControlSet\Control\TimeZoneInformation\ActiveTimeBias")
    If IsArray(timeShiftValue) Then
    timeShift = 0
    For i = 0 To UBound(timeShiftValue)
    timeShift = timeShift + (timeShiftValue(i) * 256^i)
    Next
    Else
    timeShift = timeShiftValue
    End If

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

    'der Large Integer wird mit zwei Long Werten gehandhabt (HighPart und LowPart)
    i8High = value.HighPart
    i8Low = value.LowPart
    If (i8Low < 0) Then
    i8High = i8High + 1
    End If

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

    'das Datum und die Uhrzeit ausrechnen: 100-Nanosecond-Schritte seit dem 1. Januar 1601
    If (i8High = 0) And (i8Low = 0) Then
    LargeIntegerToDate = #1/1/1601#
    Else
    LargeIntegerToDate = #1/1/1601# + (((i8High * 2^32) + i8Low)/600000000 - timeShift)/1440
    End If
    End Function

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

    Function DateToLargeIntegerString(value)
    'nimmt ein Datun+Uhrzeit und gibt den entsprechenden Microsoft LargeInteger Wert (Integer8) zurück

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

    'erst die lokale Zeitabweichung aus der Registry auslesen
    Set sho = CreateObject("Wscript.Shell")
    timeShiftValue = sho.RegRead("HKLM\System\CurrentControlSet\Control\TimeZoneInformation\ActiveTimeBias")
    If IsArray(timeShiftValue) Then
    timeShift = 0
    For i = 0 To UBound(timeShiftValue)
    timeShift = timeShift + (timeShiftValue(i) * 256^i)
    Next
    Else
    timeShift = timeShiftValue
    End If

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

    'die Zeit von lokaler Zeit in UTC umrechnen
    value = DateAdd("n", timeShift, value)
    'msgbox(value)
    value=InputBox(value,"Enter Date",value)

    'wieviele Sekunden seit 1601 sind vergangen?
    secs = DateDiff("s", #1/1/1601#, value)

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

    'in Nano-Sekunden umrechnen
    DateToLargeIntegerString = CStr(secs) & "0000000"
    llt = DateToLargeIntegerString
    value=InputBox(value,"berechnet w32 /ntte xxxx",llt)
    End Function

    [/autoit]

    gruß gmmg

  • Script pausiert einfach so: Gründe / Lösung

    • gmmg
    • 3. Februar 2014 um 14:05

    Landfloh

    du kannst das doch auch gleich in deienr 1. GUI mit unterbringen!
    das sollte eigentlich funktionieren ...

    Beispiel ....

    [autoit]


    ;testgui

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

    #include <GUIConstantsEx.au3>

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

    Opt('MustDeclareVars', 1)

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

    Local $button_1,$button_2, $button_3, $button_4
    Local $Halt, $msg

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

    AdlibRegister("timer", 10000) ;alle 10 sek

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

    Opt("GUICoordMode", 1)
    GUICreate("Test", 140, 260)

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

    $button_1 = GUICtrlCreateButton("Earth", 20, 20, 100, 40)
    $button_2 = GUICtrlCreateButton("Water", 20, 80, 100, 40)
    $button_3 = GUICtrlCreateButton("Fire", 20, 140, 100, 40)
    $button_4 = GUICtrlCreateButton("Air", 20, 200, 100, 40)

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

    GUISetState()

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

    While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    AdlibUnRegister("timer")
    Exit
    Case $msg = $GUI_EVENT_MINIMIZE
    Case $msg = $GUI_EVENT_MAXIMIZE

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

    Case $msg = $button_1
    WinActivate ("Earth")
    Case $msg = $button_2
    WinActivate ("Water")
    Case $msg = $button_3
    WinActivate ("Fire")
    Case $msg = $button_4
    WinActivate ("Air")

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

    Case $Halt = $msg

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

    EndSelect
    WEnd

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

    Func timer()
    ;MsgBox(0,"","test",1) ;Test MSGBOX
    WinActivate("Test")
    WinSetOnTop("Test","",1)
    EndFunc

    [/autoit]

    gruß gmmg

  • Buttonfarbe ändern - Wenn PC im Netzwerk online ist grün, ansonsten rot

    • gmmg
    • 31. Januar 2014 um 16:10

    Legatos

    folgend mal ein Ausschnitt für farbige Buttons!

    [autoit]


    $Form1 = GUICreate(test", 246, 161, 359, 376)
    GUISetBkColor(0xC0C0B2)
    $Button1 = GUICtrlCreateButton("Grün", 32, 16, 73, 25)
    GUICtrlSetBkColor($Button1,0x66CC00)
    $Button2 = GUICtrlCreateButton("Rot", 144, 16, 73, 25)
    GUICtrlSetBkColor($Button2,0xff4D00)

    [/autoit]


    Gruß gmmg

  • Altiris, "Silent Installation"

    • gmmg
    • 30. Januar 2014 um 14:43

    hallo,

    wir haben auch als Softwareverteilung Altiris!
    Hatten schonmal so einen Ähnlichen Fall!
    Hier haben wir das Paket in etwa so erstellt ...

    [autoit]


    1. Batch
    **************************+
    c:\drivers\tools\addreg "HKEY_LOCAL_MACHINE64\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" "DefaultUserName" "Administrator"
    c:\drivers\tools\addreg "HKEY_LOCAL_MACHINE64\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" "DefaultPassword" "passwort"
    c:\drivers\tools\addreg "HKEY_LOCAL_MACHINE64\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" "AutoAdminLogon" "1"

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

    shutdown -r -f -t 1

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

    c:\drivers\tools\sleep.exe 80
    *******************************************
    2. Batch
    *******************************************
    set sourcedir=%~dp0
    set destindir=D:\Setup\Software\Test
    mkdir D:\Setup\Software\Test
    xcopy %sourcedir%source\*.* %destindir% /s /e /v /y
    %destindir%\Setup.exe
    md c:\Testdir

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

    c:\drivers\tools\addreg "HKEY_LOCAL_MACHINE64\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" "DefaultPassword" ""
    c:\drivers\tools\addreg "HKEY_LOCAL_MACHINE64\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" "AutoAdminLogon" "0"

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

    shutdown -r -f -t 1
    c:\drivers\tools\sleep.exe 60
    *******************************************

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

    Also Praktisch wird der Autologin in der Registry in der ersten Batch gesetzt!
    Im Zweiten dann das setup ausgeführt und danach der Autologin aus der Registry entfernt!

    damit haben wir ca. 300 Clients installiert ...

    vielleicht hilft es ja weiter :)

    gruß gmmg

  • Excel File als .csv speichern

    • gmmg
    • 22. Januar 2014 um 15:09

    hallo vakaba,

    was ist mit der internen excel funktion _ExcelBookSaveAs?
    hier kannst du die datei mit folgenden endungen speichern ... "xls|csv|txt|template|html", default "xls"

    gruß gmmg

  • WebTcp Session an Internet Explorer übergeben

    • gmmg
    • 15. Januar 2014 um 13:38

    schaust du hier! WebTcp

    mit beispiel ... vielleicht hilft das weiter oder hast du das schon angeschaut?

    gruß gmmg

  • Programm im UNC Pfad öffnen

    • gmmg
    • 18. Dezember 2013 um 13:58

    hallo zusammen,

    bei mir funktioniert es mit exe oder cmd / bat Dateien wie folgt!

    [autoit]


    ShellExecute("\\Server_yxz\Share\Programm1\test.exe")
    ShellExecute("\\Server_yxz\Share\Programm2\test.cmd")

    [/autoit]

    Share ist dabei die Freigabe auf Server_yxz ...

    Inhalt der cmd

    Spoiler anzeigen


    @echo off
    title Programmname
    c:
    cd \
    %HOMEDRIVE%
    javaws http://10.x.0.x:8080/anwendung.jnlp
    exit

    reicht es hier nicht auch einfach das @WorkingDir zu setzen?

    ... aus der Hilfe ...
    FileChangeDir ... Changes the current working directory.
    FileChangeDir ( "path" )


    Gruß gmmg

  • Problem: 2 Browserfenster sollen auf 2 Monitoren beim Starten fullscreen öffnen

    • gmmg
    • 29. November 2013 um 14:33

    @Robert

    besser hätte ich es nicht erklären können!
    man könnte ja den Titel noch mit WinGetTitle usw. auslesen ...

    Es wurde ja nicht angegeben, welche Webseiten dargestellt werden sollen, kann ja auch was internes sein ...

    gruß gmmg

  • Problem: 2 Browserfenster sollen auf 2 Monitoren beim Starten fullscreen öffnen

    • gmmg
    • 29. November 2013 um 14:00

    @azubine

    schau dir in der Autoit Hilfe mal die Befehle WinWait, WinMove, WinSetState an ...
    Wobei WinSetState nur das Fenster Maximieren soll ...

    $x1 und $y1 sind jeweils die Koordinaten ... bedeutet , dass das erste Fenster am Bildschirm links Oben bei Pixel 0 beginnt
    $x2 und $y2 heißt, dass das zweite Fenster bei Pixel 1168 beginnt .. je nachdem, wie groß die Auflösung vom Bildschirm ist, muss dass angepasst werden ...

    Probiere da doch einfach mal bisschen mit den Koordinaten hin und her ...
    Hab mal noch paar Kommentare eingefügt ... und ein Bild angehangen ..

    Spoiler anzeigen
    [autoit]


    ;-----Anfang Bildschirm 1-----
    $x1 = 0
    $y1 = 0
    $titel1 = "Welcome to ALDI - Mozilla Firefox" ; Fenstertitel des Firefox Fenster Aldi.de

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

    Run("C:\Program Files (x86)\Mozilla Firefox\firefox.exe -new-window http://www.aldi.de") ; Achtung, der Programmpfad von firefox kann je nach Betriebssystem, 32Bit/64Bit variieren
    WinWait($titel1)
    WinMove($titel1,"", $x1 , $y1)
    WinSetState($titel1, "", @SW_MAXIMIZE)
    ;-----Ende Bildschirm 1-----

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

    ;-----Anfang Bildschirm 2-----
    $x2 = 1168
    $y2 = 0
    $titel2 = "NETTO.de - Nur echt mit dem Scottie. - Mozilla Firefox" ; Fenstertitel des Firefox Fenster Netto.de

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

    Run("C:\Program Files (x86)\Mozilla Firefox\firefox.exe -new-window http://www.netto.de") ; Achtung, der Programmpfad von firefox kann je nach Betriebssystem, 32Bit/64Bit variieren
    WinWait($titel2)
    WinMove($titel2,"", $x2 , $y2)
    WinSetState($titel2, "", @SW_MAXIMIZE)
    ;-----Ende Bildschirm 2-----

    [/autoit]

    Anbei auch nochmal die au3 Datei ... Diese sollte bei dir so funktionieren ..

    gruß gmmg

    Dateien

    Fenstertitel.PNG 72,69 kB – 0 Downloads monitor.au3 972 Byte – 490 Downloads
  • Problem: 2 Browserfenster sollen auf 2 Monitoren beim Starten fullscreen öffnen

    • gmmg
    • 29. November 2013 um 11:42

    Hallo,

    habe hier auch mal so was in der Art gemacht ...
    Ganz einfach ... :) die Webseiten sind als Beispiel so gewählt ...

    Mega war aber schneller mit seiner schöneren Lösung :o)

    [autoit]


    ;Bildschirm 1
    $x1 = 0
    $y1 = 0
    $titel1 = "Welcome to ALDI - Mozilla Firefox" ; der Anzeigetitel der Webseite
    ;Bildschirm 2
    $x2 = 1024 ; hier die Zahl entsprechend, dass das zweite Fenster in den zweiten Bildschirm passt
    $y2 = 0
    $titel2 = "NETTO.de - Nur echt mit dem Scottie. - Mozilla Firefox" ; der Anzeigetitel der Webseite
    ; startet firefox 1 als neues Fenster und übergibt die URL
    Run("C:\Program Files (x86)\Mozilla Firefox\firefox.exe -new-window http://www.aldi.de")
    WinWait($titel1)
    WinMove($titel1,"", $x1 , $y1)
    WinSetState($titel1, "", @SW_MAXIMIZE) ; Maximiert das Fenster
    ; startet firefox 2 als neues Fenster und übergibt die URL
    Run("C:\Program Files (x86)\Mozilla Firefox\firefox.exe -new-window http://www.netto.de")
    WinWait($titel2)
    WinMove($titel2,"", $x2 , $y2)
    WinSetState($titel2, "", @SW_MAXIMIZE) ; Maximiert das Fenster

    [/autoit]

    gruß gmmg

  • Pflichtfelder (Radio Button, Edit Feld) vor dem Absenden des Formulars auf Inhalt prüfen

    • gmmg
    • 27. November 2013 um 14:36

    BugFix ,

    ich habe jetzt das Array wie folgt $aLeftTopTitle[9][4] erweitert, um zwei weitere Editboxen hinzuzufügen ....

    [autoit]


    Global $aLeftTopTitle[9][4] = [[80,190,"1. Objektivität / Fairness ", 1],[80,420,"2. Kompetenz in seiner Aufgabe ",1],[80,640,"3. Verständnis für Anliegen/Probleme ",1], _
    [465,190,"4. Hilfsbereitschaft ",1],[465,420,"5. Loyalität ",1],[465,640,"6. Fähigkeit zum Vermitteln von Zusammenhängen ",1], _
    [850,190,"7. Motivation ",1],[850,420,"8. test 8 ohne Radio",0], [850,640,"9. test 9 ohne Radio",0]]
    Global $aCtrlArray[9]

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

    For $i = 0 To 8
    $aCtrlArray[$i] = _Group_w_Radio($aLeftTopTitle[$i][2], $aLeftTopTitle[$i][0], $aLeftTopTitle[$i][1], $aLeftTopTitle[$i][3], 350, 200)
    Next

    [/autoit]


    1 = Radio Button vorhanden
    0 = ohne Radio Button

    dann in der Func _Group_w_Radio($_sTitle, $_iX, $_iY, $radio_yes, $_iW, $_iH) den wert "$radio_yes" erweitert ..

    siehe schript ...

    Spoiler anzeigen
    [autoit]


    #include <WindowsConstants.au3>
    GUICreate("... Feedback Tool ...",@DesktopWidth,@DesktopHeight,0,0, $WS_OVERLAPPEDWINDOW)

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

    Global $sPathIcon = @ScriptDir & "\SMILEYS" ; == Smileys im Anhang, Pfad anpassen.

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

    Global $aPict[6] = [ _
    $sPathIcon & "1.ico", _
    $sPathIcon & "2.ico", _
    $sPathIcon & "3.ico", _
    $sPathIcon & "4.ico", _
    $sPathIcon & "5.ico", _
    $sPathIcon & "6.ico"]

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

    Global $aLeftTopTitle[9][4] = [[80,190,"1. Objektivität / Fairness ", 1],[80,420,"2. Kompetenz in seiner Aufgabe ",1],[80,640,"3. Verständnis für Anliegen/Probleme ",1], _
    [465,190,"4. Hilfsbereitschaft ",1],[465,420,"5. Loyalität ",1],[465,640,"6. Fähigkeit zum Vermitteln von Zusammenhängen ",1], _
    [850,190,"7. Motivation ",1],[850,420,"8. test 8 ohne Radio",0], [850,640,"9. test 9 ohne Radio",0]]
    Global $aCtrlArray[9]

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

    For $i = 0 To 8
    $aCtrlArray[$i] = _Group_w_Radio($aLeftTopTitle[$i][2], $aLeftTopTitle[$i][0], $aLeftTopTitle[$i][1], $aLeftTopTitle[$i][3], 350, 200)
    Next

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

    $Button_Absenden = GUICtrlCreateButton( "Formular Absenden",@DesktopWidth * (50 /100) -50,900,130,30, 0x0C00 )

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

    GUISetState()

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

    While 1
    $nMsg = GUIGetMsg()
    If $nMsg = -3 Then Exit
    For $i = 0 To 8
    $aTmpCtrl = $aCtrlArray[$i]
    For $j = 0 To 5
    If $nMsg = $aTmpCtrl[$j] Then
    GUICtrlSetImage($aTmpCtrl[6], $aPict[$j])
    ExitLoop(2)
    EndIf
    Next
    Next
    Switch $nMsg
    Case $Button_Absenden
    MsgBox(0, "", "First Case expression was true")
    EndSwitch
    WEnd

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

    Func _Group_w_Radio($_sTitle, $_iX, $_iY, $r_yes_now, $_iW, $_iH)
    Local $aCtrl[8] ; == 6*Radio, 1*Icon, 1*Edit
    Local $iW_radio = 40 ; == HIER kannst du variieren im Abstand der Radios
    GUICtrlCreateGroup($_sTitle, $_iX, $_iY, $_iW, $_iH)
    GUICtrlSetFont(-1, 10, 120, 0, "Arial")
    For $i = 0 To 5 ; == Radio erstellen
    $iStyle = Default
    If $i = 0 Then $iStyle = $WS_GROUP
    If $r_yes_now = 1 then $aCtrl[$i] = GUICtrlCreateRadio( $i+1, $_iX +20 +$i*$iW_radio, $_iY +30, $iW_radio, 20, $iStyle)
    Next
    If $r_yes_now = 1 then $aCtrl[6] = GUICtrlCreateIcon("", -1, $_iX +$_iW -60, $_iY +20, 40, 40)
    $aCtrl[7] = GUICtrlCreateEdit("", $_iX +20, $_iY +70, $_iW -40, $_iH -80)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    Return $aCtrl
    EndFunc

    [/autoit]

    kannst du mal bitte drüber schauen, ob dass so passt?
    nun müsste ja genauso abgefragt werden, dass alle elemente einer Group ausgefüllt sind! also Radio Button geklickt und Edit ausgefüllt!

    Danke
    gruß gmmg

  • Pflichtfelder (Radio Button, Edit Feld) vor dem Absenden des Formulars auf Inhalt prüfen

    • gmmg
    • 26. November 2013 um 14:50

    Hallo Bugfix,

    das dachte ich mir schon, dass dies einfacher geht!

    Danke für deine Unterstützung :) Werd mir das mal ansehen und entsprechend umsetzen ...

    Hab da noch ne Frage ... Wenn ich jetzt weitere Groups hinzufügen möchte, die aber nur eine EditBox haben, müsste ich doch den Bereich "$aLeftTopTitle[7][3]" erweitern und dann keine Radios erzeugen oder?


    Gruß gmmg

    Dateien

    bild.PNG 13,83 kB – 0 Downloads
  • Pflichtfelder (Radio Button, Edit Feld) vor dem Absenden des Formulars auf Inhalt prüfen

    • gmmg
    • 26. November 2013 um 13:21

    hallo Bugfix,

    funktioniert es dann denn auch, dass sich das Bild zur Laufzeit ändert, je nachdem, welchen RadioButton 1 bis RadioButton 6 einer Group gesetzt wird?

    Als Beispiel, wenn RadioButton 1 geklickt wird, soll Bild 1 zur laufzeit geändert werden, bei RadioButton 2 Bild 2 usw .. (siehe Bild)

    Gruß gmmg

    Dateien

    Bilder.gif 16,7 kB – 0 Downloads
  • Pflichtfelder (Radio Button, Edit Feld) vor dem Absenden des Formulars auf Inhalt prüfen

    • gmmg
    • 26. November 2013 um 11:22

    Hallo Zusammen,

    hier nochmal mein script, welches auch erstmal funktioniert und die Daten entsprechend in eine MySQL Tabelle schreibt!
    Hab noch mal paar Fragen zum vereinfachen des Quellcodes im Case Bereich!

    Wie kann ich es vereinfacht machen, dass beim auswählen eines der radiobuttons einer group sich ein bild ändert ..
    derzeit hab ich für jeden radiobutton ein Case erstellt, was natürlich funktioniert, aber nicht sinnvoll ist ...

    Eventuell kann nochmal einer drüber schauen und mir noch einen Tipp geben ...

    Spoiler anzeigen
    [autoit][/autoit] [autoit][/autoit] [autoit]

    #include <Array.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Include <File.au3>
    #include <mysql/mysql.au3>
    #include <array.au3>
    #include <Date.au3>
    #include <String.au3>
    #include <D:\Data\scripte\AD_1.3.0.0_Functions\AD.au3>

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

    Local $MysqlConn, $department , $result, $result01, $TL_ini, $TL, $aUser01
    Local $wert_edit
    Local $avArray[1]

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

    ;_TL_auslesen() ; die Funktion hab ich mal entfernt ...
    ;$standardCombo = StringSplit ($TL,"|")
    GUICreate("... Feedback Tool ...",@DesktopWidth,@DesktopHeight,0,0, $WS_OVERLAPPEDWINDOW) ; will create a dialog box that when displayed is centered
    ;$iPic = GUICtrlCreatePic(@ScriptDir & "\pic\hg.jpg", 0, 0, @DesktopWidth, @DesktopHeight)
    ;GUICtrlSetState($iPic, $GUI_DISABLE)
    ;$TL_Combo = GUICtrlCreateCombo("",570, 90,150,20) ; create first item
    ;$Label_1 = GUICtrlCreateLabel("... Feedback Tool ...",520,30,260,50)
    ;GUICtrlSetFont($Label_1,22,120, 0, "Arial")
    ;GUICtrlSetData($TL_Combo, $TL,$standardCombo[1]) ; add other item snd set a new default
    ;----------erste spalte ----------------------------------------------
    $top_1 = 190
    $top_2 = 420
    $top_3 = 640
    $left_s1 = 100
    $left_s2 = 510
    $left_s3 = 920
    $group_w = 350
    $group_h = 200
    $group_ht = 150

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

    Global $RadioButtonGroups[7][6]
    Global $EditGroups [10][1]
    #Region Groups
    GUICtrlCreateGroup("1. Objektivität / Fairness ", 70, 150, $group_w, $group_h)
    GUICtrlSetFont(-1,10,120, 0, "Arial")
    $RadioButtonGroups[0][0] = GUICtrlCreateRadio( "1", $left_s1 + 00,$top_1, 30, 20, $WS_GROUP)
    $RadioButtonGroups[0][1] = GUICtrlCreateRadio( "2", $left_s1 + 30,$top_1, 30, 20)
    $RadioButtonGroups[0][2] = GUICtrlCreateRadio( "3", $left_s1 + 60,$top_1, 30, 20)
    $RadioButtonGroups[0][3] = GUICtrlCreateRadio( "4", $left_s1 + 90,$top_1, 30, 20)
    $RadioButtonGroups[0][4] = GUICtrlCreateRadio( "5", $left_s1 + 120,$top_1, 30, 20)
    $RadioButtonGroups[0][5] = GUICtrlCreateRadio( "6", $left_s1 + 150,$top_1, 30, 20)
    $pic01 = GUICtrlCreatePic("", $left_s1 + 200, $top_1 -5, 44, 44)
    $EditGroups[0][0] = GUICtrlCreateEdit("", 90, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("2. Kompetenz in seiner Aufgabe ", 70, 380, $group_w, $group_h)
    GUICtrlSetFont(-1,10,120, 0, "Arial")
    $RadioButtonGroups[1][0] = GUICtrlCreateRadio("1",$left_s1 + 00, $top_2, 30, 20, $WS_GROUP)
    $RadioButtonGroups[1][1] = GUICtrlCreateRadio("2",$left_s1 + 30, $top_2, 30, 20)
    $RadioButtonGroups[1][2] = GUICtrlCreateRadio("3",$left_s1 + 60, $top_2, 30, 20)
    $RadioButtonGroups[1][3] = GUICtrlCreateRadio("4",$left_s1 + 90, $top_2, 30, 20)
    $RadioButtonGroups[1][4] = GUICtrlCreateRadio("5",$left_s1 + 120, $top_2, 30, 20)
    $RadioButtonGroups[1][5] = GUICtrlCreateRadio("6",$left_s1 + 150, $top_2, 30, 20)
    $pic02 = GUICtrlCreatePic("", $left_s1 + 200, $top_2 -5, 44, 44)
    $EditGroups[1][0] = GUICtrlCreateEdit("", 90, 465, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("3. Verständnis für Anliegen/Probleme ", 70, 610, $group_w, $group_h)
    GUICtrlSetFont(-1,10,120, 0, "Arial")
    $RadioButtonGroups[2][0] = GUICtrlCreateRadio("1",$left_s1 + 00, $top_3, 30, 20, $WS_GROUP)
    $RadioButtonGroups[2][1] = GUICtrlCreateRadio("2",$left_s1 + 30, $top_3, 30, 20)
    $RadioButtonGroups[2][2] = GUICtrlCreateRadio("3",$left_s1 + 60, $top_3, 30, 20)
    $RadioButtonGroups[2][3] = GUICtrlCreateRadio("4",$left_s1 + 90, $top_3, 30, 20)
    $RadioButtonGroups[2][4] = GUICtrlCreateRadio("5",$left_s1 + 120, $top_3, 30, 20)
    $RadioButtonGroups[2][5] = GUICtrlCreateRadio("6",$left_s1 + 150, $top_3, 30, 20)
    $pic03 = GUICtrlCreatePic("", $left_s1 + 200, $top_3 -5, 44, 44)
    $EditGroups[2][0] = GUICtrlCreateEdit("", 90, 690, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    ;----------zweite spalte ----------------------------------------------
    GUICtrlCreateGroup("4. Hilfsbereitschaft ", 475, 150, $group_w, $group_h)
    GUICtrlSetFont(-1,10,120, 0, "Arial")
    $RadioButtonGroups[3][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_1, 30, 20, $WS_GROUP)
    $RadioButtonGroups[3][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_1, 30, 20)
    $RadioButtonGroups[3][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_1, 30, 20)
    $RadioButtonGroups[3][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_1, 30, 20)
    $RadioButtonGroups[3][4] = GUICtrlCreateRadio("5", $left_s2 + 120, $top_1, 30, 20)
    $RadioButtonGroups[3][5] = GUICtrlCreateRadio("6", $left_s2 + 150, $top_1, 30, 20)
    $pic04 = GUICtrlCreatePic("", $left_s2 + 200, $top_1 -5, 44, 44)
    $EditGroups[3][0] = GUICtrlCreateEdit("", 495, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("5. Loyalität ", 475, 380, $group_w, $group_h)
    GUICtrlSetFont(-1,10,120, 0, "Arial")
    $RadioButtonGroups[4][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_2, 30, 20, $WS_GROUP)
    $RadioButtonGroups[4][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_2, 30, 20)
    $RadioButtonGroups[4][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_2, 30, 20)
    $RadioButtonGroups[4][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_2, 30, 20)
    $RadioButtonGroups[4][4] = GUICtrlCreateRadio("5", $left_s2 + 120,$top_2, 30, 20)
    $RadioButtonGroups[4][5] = GUICtrlCreateRadio("6", $left_s2 + 150,$top_2, 30, 20)
    $pic05 = GUICtrlCreatePic("", $left_s2 + 200, $top_2 -5, 44, 44)
    $EditGroups[4][0] = GUICtrlCreateEdit("", 495, 465, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("6. Fähigkeit zum Vermitteln von Zusammenhängen ", 475, 610, $group_w, $group_h)
    GUICtrlSetFont(-1,10,120, 0, "Arial")
    $RadioButtonGroups[5][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_3, 30, 20, $WS_GROUP)
    $RadioButtonGroups[5][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_3, 30, 20)
    $RadioButtonGroups[5][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_3, 30, 20)
    $RadioButtonGroups[5][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_3, 30, 20)
    $RadioButtonGroups[5][4] = GUICtrlCreateRadio("5", $left_s2 + 120,$top_3, 30, 20)
    $RadioButtonGroups[5][5] = GUICtrlCreateRadio("6", $left_s2 + 150,$top_3, 30, 20)
    $pic06 = GUICtrlCreatePic("", $left_s2 + 200, $top_3 -5, 44, 44)
    $EditGroups[5][0] = GUICtrlCreateEdit("", 495, 690, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    ;----------dritte spalte ----------------------------------------------
    GUICtrlCreateGroup("7. Motivation ", 880, 150, $group_w, $group_h)
    GUICtrlSetFont(-1,10,120, 0, "Arial")
    $RadioButtonGroups[6][0] = GUICtrlCreateRadio("1", $left_s3 + 00, $top_1, 30, 20, $WS_GROUP)
    $RadioButtonGroups[6][1] = GUICtrlCreateRadio("2", $left_s3 + 30, $top_1, 30, 20)
    $RadioButtonGroups[6][2] = GUICtrlCreateRadio("3", $left_s3 + 60, $top_1, 30, 20)
    $RadioButtonGroups[6][3] = GUICtrlCreateRadio("4", $left_s3 + 90, $top_1, 30, 20)
    $RadioButtonGroups[6][4] = GUICtrlCreateRadio("5", $left_s3 + 120, $top_1, 30, 20)
    $RadioButtonGroups[6][5] = GUICtrlCreateRadio("6", $left_s3 + 150, $top_1, 30, 20)
    $pic07 = GUICtrlCreatePic("", $left_s3 + 200, $top_1 -5, 44, 44)
    $EditGroups[6][0] = GUICtrlCreateEdit("", 900, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("8. Was ist aus deiner Sicht besonders positiv? ", 880, 380, $group_w, $group_ht)
    GUICtrlSetFont(-1,10,120, 0, "Arial")
    $EditGroups[7][0] = GUICtrlCreateEdit("", 900, 410, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("9. Was ist aus deiner Sicht besonders negativ? ", 880, 560, $group_w, $group_ht)
    GUICtrlSetFont(-1,10,120, 0, "Arial")
    $EditGroups[8][0] = GUICtrlCreateEdit("", 900, 590, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("10. weitere Anmerkungen! ", 880, 740, $group_w, $group_ht)
    GUICtrlSetFont(-1,10,120, 0, "Arial")
    $EditGroups[9][0] = GUICtrlCreateEdit("", 900, 770, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group
    #EndRegion Groups

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

    $Button_Absenden = GUICtrlCreateButton( "Formular Absenden",@DesktopWidth * (50 /100) -50,900,130,30, 0x0C00 )

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

    GUISetState()

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

    While 1
    $nMsg = GUIGetMsg()

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

    Switch $nMsg

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

    Case $GUI_EVENT_CLOSE
    Exit

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

    Case $TL_Combo
    ;-------------------------------------------------------------
    Case $RadioButtonGroups[0][0]
    GUICtrlSetImage($pic01, @ScriptDir & "\pic\SM01.gif")
    Case $RadioButtonGroups[0][1]
    GUICtrlSetImage($pic01, @ScriptDir & "\pic\SM02.gif")
    Case $RadioButtonGroups[0][2]
    GUICtrlSetImage($pic01, @ScriptDir & "\pic\SM03.gif")
    Case $RadioButtonGroups[0][3]
    GUICtrlSetImage($pic01, @ScriptDir & "\pic\SM04.gif")
    Case $RadioButtonGroups[0][4]
    GUICtrlSetImage($pic01, @ScriptDir & "\pic\SM05.gif")
    Case $RadioButtonGroups[0][5]
    GUICtrlSetImage($pic01, @ScriptDir & "\pic\SM06.gif")
    ;-------------------------------------------------------------
    Case $RadioButtonGroups[1][0]
    GUICtrlSetImage($pic02, @ScriptDir & "\pic\SM01.gif")
    Case $RadioButtonGroups[1][1]
    GUICtrlSetImage($pic02, @ScriptDir & "\pic\SM02.gif")
    Case $RadioButtonGroups[1][2]
    GUICtrlSetImage($pic02, @ScriptDir & "\pic\SM03.gif")
    Case $RadioButtonGroups[1][3]
    GUICtrlSetImage($pic02, @ScriptDir & "\pic\SM04.gif")
    Case $RadioButtonGroups[1][4]
    GUICtrlSetImage($pic02, @ScriptDir & "\pic\SM05.gif")
    Case $RadioButtonGroups[1][5]
    GUICtrlSetImage($pic02, @ScriptDir & "\pic\SM06.gif")
    ;-------------------------------------------------------------
    Case $RadioButtonGroups[2][0]
    GUICtrlSetImage($pic03, @ScriptDir & "\pic\SM01.gif")
    Case $RadioButtonGroups[2][1]
    GUICtrlSetImage($pic03, @ScriptDir & "\pic\SM02.gif")
    Case $RadioButtonGroups[2][2]
    GUICtrlSetImage($pic03, @ScriptDir & "\pic\SM03.gif")
    Case $RadioButtonGroups[2][3]
    GUICtrlSetImage($pic03, @ScriptDir & "\pic\SM04.gif")
    Case $RadioButtonGroups[2][4]
    GUICtrlSetImage($pic03, @ScriptDir & "\pic\SM05.gif")
    Case $RadioButtonGroups[2][5]
    GUICtrlSetImage($pic03, @ScriptDir & "\pic\SM06.gif")
    ;-------------------------------------------------------------
    Case $RadioButtonGroups[3][0]
    GUICtrlSetImage($pic04, @ScriptDir & "\pic\SM01.gif")
    Case $RadioButtonGroups[3][1]
    GUICtrlSetImage($pic04, @ScriptDir & "\pic\SM02.gif")
    Case $RadioButtonGroups[3][2]
    GUICtrlSetImage($pic04, @ScriptDir & "\pic\SM03.gif")
    Case $RadioButtonGroups[3][3]
    GUICtrlSetImage($pic04, @ScriptDir & "\pic\SM04.gif")
    Case $RadioButtonGroups[3][4]
    GUICtrlSetImage($pic04, @ScriptDir & "\pic\SM05.gif")
    Case $RadioButtonGroups[3][5]
    GUICtrlSetImage($pic04, @ScriptDir & "\pic\SM06.gif")
    ;-------------------------------------------------------------
    Case $RadioButtonGroups[4][0]
    GUICtrlSetImage($pic05, @ScriptDir & "\pic\SM01.gif")
    Case $RadioButtonGroups[4][1]
    GUICtrlSetImage($pic05, @ScriptDir & "\pic\SM02.gif")
    Case $RadioButtonGroups[4][2]
    GUICtrlSetImage($pic05, @ScriptDir & "\pic\SM03.gif")
    Case $RadioButtonGroups[4][3]
    GUICtrlSetImage($pic05, @ScriptDir & "\pic\SM04.gif")
    Case $RadioButtonGroups[4][4]
    GUICtrlSetImage($pic05, @ScriptDir & "\pic\SM05.gif")
    Case $RadioButtonGroups[4][5]
    GUICtrlSetImage($pic05, @ScriptDir & "\pic\SM06.gif")
    ;-------------------------------------------------------------
    Case $RadioButtonGroups[5][0]
    GUICtrlSetImage($pic06, @ScriptDir & "\pic\SM01.gif")
    Case $RadioButtonGroups[5][1]
    GUICtrlSetImage($pic06, @ScriptDir & "\pic\SM02.gif")
    Case $RadioButtonGroups[5][2]
    GUICtrlSetImage($pic06, @ScriptDir & "\pic\SM03.gif")
    Case $RadioButtonGroups[5][3]
    GUICtrlSetImage($pic06, @ScriptDir & "\pic\SM04.gif")
    Case $RadioButtonGroups[5][4]
    GUICtrlSetImage($pic06, @ScriptDir & "\pic\SM05.gif")
    Case $RadioButtonGroups[5][5]
    GUICtrlSetImage($pic06, @ScriptDir & "\pic\SM06.gif")
    ;-------------------------------------------------------------
    Case $RadioButtonGroups[6][0]
    GUICtrlSetImage($pic07, @ScriptDir & "\pic\SM01.gif")
    Case $RadioButtonGroups[6][1]
    GUICtrlSetImage($pic07, @ScriptDir & "\pic\SM02.gif")
    Case $RadioButtonGroups[6][2]
    GUICtrlSetImage($pic07, @ScriptDir & "\pic\SM03.gif")
    Case $RadioButtonGroups[6][3]
    GUICtrlSetImage($pic07, @ScriptDir & "\pic\SM04.gif")
    Case $RadioButtonGroups[6][4]
    GUICtrlSetImage($pic07, @ScriptDir & "\pic\SM05.gif")
    Case $RadioButtonGroups[6][5]
    GUICtrlSetImage($pic07, @ScriptDir & "\pic\SM06.gif")
    ;-------------------------------------------------------------
    Case $Button_Absenden
    $wert_edit = ""
    $feld = ""
    Local $avArray[1] ;wenn nicht alle Felder gefüllt sind erstelle leeres Array ...

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

    If _pruefen( $RadioButtonGroups ) = True Then
    ;MsgBox(0,"Radio 2 alles ok", ":)" )
    ;_ArrayDisplay($avArray)
    ;Exit

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

    ;---begin abfrage Edit box------
    _editbox()
    _av_array_Search()
    ;MsgBox(0,"", $feld)

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

    IF $feld = "leer" Then
    MsgBox(0,"Edit Info","...Bitte alle Felder ausfüllen!...")
    ;_ArrayDisplay($avArray)
    Local $avArray[1] ;wenn nicht alle Felder gefüllt sind erstelle leeres Array ...
    ;_ArrayDisplay($avArray)
    Else
    ;MsgBox(0,"1 alles ok",$feld)
    ;$wert_TL = GUICtrlRead($TL_Combo)
    ;If $wert_TL = "NotFound" Or $wert_TL = "" Then
    ; MsgBox(0,"Hinweis","kein Teamleiter ausgewählt oder keine Auswahl verfügbar!")
    ;Else
    MsgBox(0,"1 alles ok","Die Daten werden übermittelt!")
    _ArrayAdd($avArray, "TL" & "|" & $wert_TL)
    _ArrayAdd($avArray, "User" & "|" & @username)
    ;_ArrayDisplay($avArray)
    _insert_db() ; eintrag in die DB
    _leeren() ; DB Variablen leeren
    Exit
    ;EndIf
    EndIf
    ;---end abfrage Edit box------

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

    Else
    MsgBox(0,"Radio Info","...Bitte alle Felder ausfüllen!...")
    Local $AllNeededDataFound = False
    EndIf

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

    EndSwitch
    WEnd

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

    Func _pruefen( $RadBtnGrps )

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

    Local $AllNeededDataFound = False

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

    If _check_all_Radio_Buttons_State( $RadBtnGrps ) = True Then
    $AllNeededDataFound = True
    Else
    $AllNeededDataFound = False
    Return $AllNeededDataFound
    EndIf

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

    Return $AllNeededDataFound
    EndFunc

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

    ;
    ; Prüft >>> alle <<< Radio Button Gruppen ob ein RadioButton gesetzt ist.
    ;
    Func _check_all_Radio_Buttons_State( $RadBtnGrps )
    Local $SizeOfRadBtnArr = UBound( $RadBtnGrps )
    Local $RadioButtonChecked = False

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

    For $Lc = 0 To $SizeOfRadBtnArr - 1
    If _is_Radio_Button_Of_Group_Checked( $RadBtnGrps, $Lc ) = True Then
    $RadioButtonChecked = True
    Else
    $RadioButtonChecked = False
    ExitLoop
    EndIf
    Next
    ;MsgBox(0,"",$RadioButtonChecked)
    Return $RadioButtonChecked
    EndFunc

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

    ;
    ; Prüft ob innerhalb einer RadioButton Gruppe ein Radio Button gestzt ist.
    ;
    Func _is_Radio_Button_Of_Group_Checked( $RadioButtonArray, $GroupNr )
    Local $SizeOfArray = UBound( $RadioButtonArray, 2 )
    Local $RadioButtonChecked = False

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

    For $Lc = 0 To $SizeOfArray - 1
    ;MsgBox(0,"",$Lc)
    If GUICtrlRead( $RadioButtonArray[$GroupNr][$Lc] ) = $GUI_CHECKED Then
    $RadioButtonChecked = True
    _ArrayAdd($avArray, "RadioBtn" & $GroupNr + 1 & "|" & $Lc + 1) ; schreibe RadioButton Werte ins Array
    ExitLoop
    EndIf
    Next

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

    Return $RadioButtonChecked

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

    EndFunc

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

    Func _editbox()

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

    Local $SizeOfEditArr = UBound( $EditGroups )
    For $LcEdit = 0 To $SizeOfEditArr - 1
    $wert_edit = GUICtrlRead($EditGroups[$LcEdit][0])
    IF $wert_edit = "" Then
    ;MsgBox(0,"Info","Bitte alle Felder ausfüllen")
    _ArrayAdd($avArray, "leer")
    Else
    ;MsgBox(0,"", $LcEdit + 1 & "|" & $wert_edit)
    _ArrayAdd($avArray, "EditFld" & $LcEdit + 1 & "|" & $wert_edit) ; schreibe Edit Werte ins Array
    EndIf
    Next

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

    EndFunc

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

    Func _av_array_Search()

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

    $feld = ""
    _ArraySearch($avArray, "leer")

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

    If @error Then
    ;MsgBox(0, "Not Found", 'was not found in the array.')
    Else
    ;MsgBox(0, "Found", 'was found in the array at position ')
    $feld = "leer"
    EndIf

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

    Return $feld

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

    EndFunc

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

    Func _insert_db()

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

    ;---MYSQL verbinden----
    ; db verbindungsvariablen
    $ipadd = ""
    $sname = ""
    $spasswort = ""
    $db = "db_tl_auswertung"

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

    _MySQL_InitLibrary()
    If @error Then Exit MsgBox(0, "Fehler", "libmysql.dll nicht gefunden")

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

    $MysqlConn = _MySQL_Init()

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

    $connected = _MySQL_Real_Connect($MysqlConn,$ipadd,$sname,$spasswort,$db)
    If $connected = 0 Then
    $errno = _MySQL_errno($MysqlConn)
    MsgBox(0,"Fehler","Login Server ist nicht Erreichbar")
    Exit
    Endif

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

    $s_Row_txt_t1 = StringSplit($avArray[1],"|") ; RadioBtn1
    $s_Row_txt_t2 = StringSplit($avArray[2],"|") ; RadioBtn2
    $s_Row_txt_t3 = StringSplit($avArray[3],"|") ; RadioBtn3
    $s_Row_txt_t4 = StringSplit($avArray[4],"|") ; RadioBtn4
    $s_Row_txt_t5 = StringSplit($avArray[5],"|") ; RadioBtn5
    $s_Row_txt_t6 = StringSplit($avArray[6],"|") ; RadioBtn6
    $s_Row_txt_t7 = StringSplit($avArray[7],"|") ; RadioBtn7
    $s_Row_txt_t8 = StringSplit($avArray[8],"|") ; EditFld1
    $s_Row_txt_t9 = StringSplit($avArray[9],"|") ; EditFld2
    $s_Row_txt_t10 = StringSplit($avArray[10],"|") ; EditFld3
    $s_Row_txt_t11 = StringSplit($avArray[11],"|") ; EditFld4
    $s_Row_txt_t12 = StringSplit($avArray[12],"|") ; EditFld5
    $s_Row_txt_t13 = StringSplit($avArray[13],"|") ; EditFld6
    $s_Row_txt_t14 = StringSplit($avArray[14],"|") ; EditFld7
    $s_Row_txt_t15 = StringSplit($avArray[15],"|") ; EditFld8
    $s_Row_txt_t16 = StringSplit($avArray[16],"|") ; EditFld9
    $s_Row_txt_t17 = StringSplit($avArray[17],"|") ; EditFld10
    $s_Row_txt_t18 = StringSplit($avArray[18],"|") ; TL
    ;MsgBox(0,"Team",$department[1])
    $s_Row_txt_t19 = $department[1] ; hier muss das Team rein
    $s_Row_txt_t20 = StringSplit($avArray[19],"|") ; User

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

    ;Truncate tavle tl_auswertung;

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

    Local $sQuery = "INSERT INTO tl_auswertung (`Objektivitaet_rdo`,`Objektivitaet_txt`," & _
    "`Aufgabenkompetenz_rdo`,`Aufgabenkompetenz_txt`," & _
    "`Verstaendnis_Anliegen_rdo`,`Verstaendnis_Anliegen_txt`," & _
    "`Hilfsbereitschaft_rdo`,`Hilfsbereitschaft_txt`," & _
    "`Loyalitaet_rdo`,`Loyalitaet_txt`," & _
    "`Zusammenhaenge_vermitteln_rdo`,`Zusammenhaenge_vermitteln_txt`," & _
    "`Motivation_rdo`,`Motivation_txt`," & _
    "`besonders_Positiv_txt`,`besonders_Negativ_txt`," & _
    "`Anmerkungen_txt`,`Teamleiter`," & _
    "`Team`,`Agent`,`Datum`) " & _
    "VALUES ('" & $s_Row_txt_t1[2] & "',"& _
    "'" & $s_Row_txt_t8[2] & "',"& _
    "'" & $s_Row_txt_t2[2] & "',"& _
    "'" & $s_Row_txt_t9[2] & "',"& _
    "'" & $s_Row_txt_t3[2] & "',"& _
    "'" & $s_Row_txt_t10[2] & "',"& _
    "'" & $s_Row_txt_t4[2] & "',"& _
    "'" & $s_Row_txt_t11[2] & "',"& _
    "'" & $s_Row_txt_t5[2] & "',"& _
    "'" & $s_Row_txt_t12[2] & "',"& _
    "'" & $s_Row_txt_t6[2] & "',"& _
    "'" & $s_Row_txt_t13[2] & "',"& _
    "'" & $s_Row_txt_t7[2] & "',"& _
    "'" & $s_Row_txt_t14[2] & "',"& _
    "'" & $s_Row_txt_t15[2] & "',"& _
    "'" & $s_Row_txt_t16[2] & "',"& _
    "'" & $s_Row_txt_t17[2] & "',"& _
    "'" & $s_Row_txt_t18[2] & "',"& _
    "'" & $s_Row_txt_t19 & "',"& _
    "'" & $s_Row_txt_t20[2] & "',"& _
    "'" & _NowDate() & "')"

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

    ;ConsoleWrite($sQuery)
    ;MsgBox(0,"",$sQuery)
    _MySQL_Real_Query($MysqlConn, $sQuery)

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

    EndFunc

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

    Func _leeren()

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

    $aRecords = ""
    $sQuery = ""

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

    EndFunc

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

    ; Verbindung beenden
    _MySQL_Close($MysqlConn)
    ; MYSQL beenden
    _MySQL_EndLibrary()

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

    Danke

    gruß gmmg :)

  • Pflichtfelder (Radio Button, Edit Feld) vor dem Absenden des Formulars auf Inhalt prüfen

    • gmmg
    • 22. November 2013 um 12:54

    Hallo Bugfix,

    das wäre mir auch lieber ... :)

    die Anordnung der Controls soll so sein, wie im Bild (Anhang) zu sehen!


    Gruß gmmg

  • Pflichtfelder (Radio Button, Edit Feld) vor dem Absenden des Formulars auf Inhalt prüfen

    • gmmg
    • 22. November 2013 um 12:37

    danke :)

    werd es mir am wochenende mal ansehen ... hatte auch die tage kaum zeit!

    gruß gmmg

  • Pflichtfelder (Radio Button, Edit Feld) vor dem Absenden des Formulars auf Inhalt prüfen

    • gmmg
    • 8. November 2013 um 09:23

    Hallo,

    habe das Script jetzt so weit, dass die Radiobuttons mit den Werten in ein Array zum Weiterverarbeiten geschrieben werden!
    Wie macht man das jetzt mit den Edit Boxen? Genauso, wie mit den Radios? hab grad schon versucht, das auslesen mit in die Func _is_Radio_Button_Of_Group_Checked einzubinden, was aber Käse ist, weil ich ja weniger Radio Groups habe wie die Edit Boxen!

    Spoiler anzeigen
    [autoit]


    Func _is_Radio_Button_Of_Group_Checked( $RadioButtonArray, $GroupNr )
    Local $SizeOfArray = UBound( $RadioButtonArray, 2 )
    Local $RadioButtonChecked = False

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

    For $Lc = 0 To $SizeOfArray - 1
    ;MsgBox(0,"",$Lc)
    If GUICtrlRead( $RadioButtonArray[$GroupNr][$Lc] ) = $GUI_CHECKED Then
    $RadioButtonChecked = True
    ;IF $Lc = 0 Then $wert_edit = GUICtrlRead($edit1)
    ;IF $Lc = 1 Then $wert_edit = GUICtrlRead($edit2)
    ;IF $Lc = 2 Then $wert_edit = GUICtrlRead($edit3)
    ;IF $Lc = 3 Then $wert_edit = GUICtrlRead($edit4)
    ;IF $Lc = 4 Then $wert_edit = GUICtrlRead($edit5)
    ;IF $Lc = 5 Then $wert_edit = GUICtrlRead($edit6)
    ;IF $Lc = 6 Then $wert_edit = GUICtrlRead($edit7)
    ;MsgBox(0,"",$wert_edit)
    ;MsgBox(0,"",$RadioButtonChecked & @CRLF & $GroupNr + 1 & @CRLF & $Lc + 1)
    ;_ArrayAdd($avArray, $GroupNr + 1 & "|" & $Lc + 1 & $wert_edit)
    _ArrayAdd($avArray, $GroupNr + 1 & "|" & $Lc + 1)
    ExitLoop
    EndIf
    Next

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

    Return $RadioButtonChecked
    EndFunc

    [/autoit]


    Version mit Array ...

    Spoiler anzeigen
    [autoit]


    #include <Excel.au3>
    #include <Array.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

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

    Dim $x, $wert_edit, $radio_x1, $radio_x2, $radio_x3, $radio_x4,$radio_x5,$radio_x6
    Local $avArray[1]

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

    GUICreate("",@DesktopWidth,@DesktopHeight,0,0, $WS_OVERLAPPEDWINDOW) ; will create a dialog box that when displayed is centered
    $TL_Combo = GUICtrlCreateCombo("",600, 100,100,20) ; create first item
    $Label_1 = GUICtrlCreateLabel("Feedback an die Teamleitung und das Qualitätsmanagement",260,30,@DesktopWidth,50)
    GUICtrlSetFont($Label_1,22,120, 0, "Arial")
    GUICtrlSetData($TL_Combo, "Teamleiter1|Teamleiter2|Teamleiter3|Teamleiter4|Teamleiter5", "Teamleiter1") ; add other item snd set a new default
    ;----------erste spalte ----------------------------------------------
    $top_1 = 190
    $top_2 = 420
    $top_3 = 640
    $left_s1 = 100
    $left_s2 = 510
    $left_s3 = 920
    $group_w = 350
    $group_h = 200
    $group_ht = 150

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

    Global $RadioButtonGroups[7][6]

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

    GUICtrlCreateGroup("1. Objektivität / Fairness ", 70, 150, $group_w, $group_h)
    $RadioButtonGroups[0][0] = GUICtrlCreateRadio( "1", $left_s1 + 00,$top_1, 30, 20, $WS_GROUP)
    $RadioButtonGroups[0][1] = GUICtrlCreateRadio( "2", $left_s1 + 30,$top_1, 30, 20)
    $RadioButtonGroups[0][2] = GUICtrlCreateRadio( "3", $left_s1 + 60,$top_1, 30, 20)
    $RadioButtonGroups[0][3] = GUICtrlCreateRadio( "4", $left_s1 + 90,$top_1, 30, 20)
    $RadioButtonGroups[0][4] = GUICtrlCreateRadio( "5", $left_s1 + 120,$top_1, 30, 20)
    $RadioButtonGroups[0][5] = GUICtrlCreateRadio( "6", $left_s1 + 150,$top_1, 30, 20)
    $edit1 = GUICtrlCreateEdit("", 90, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("2. Kompetenz in seiner Aufgabe ", 70, 380, $group_w, $group_h)
    $RadioButtonGroups[1][0] = GUICtrlCreateRadio("1",$left_s1 + 00, $top_2, 30, 20, $WS_GROUP)
    $RadioButtonGroups[1][1] = GUICtrlCreateRadio("2",$left_s1 + 30, $top_2, 30, 20)
    $RadioButtonGroups[1][2] = GUICtrlCreateRadio("3",$left_s1 + 60, $top_2, 30, 20)
    $RadioButtonGroups[1][3] = GUICtrlCreateRadio("4",$left_s1 + 90, $top_2, 30, 20)
    $RadioButtonGroups[1][4] = GUICtrlCreateRadio("5",$left_s1 + 120, $top_2, 30, 20)
    $RadioButtonGroups[1][5] = GUICtrlCreateRadio("6",$left_s1 + 150, $top_2, 30, 20)
    $edit2 = GUICtrlCreateEdit("", 90, 465, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("3. Verständnis für Anliegen/Probleme ", 70, 610, $group_w, $group_h)
    $RadioButtonGroups[2][0] = GUICtrlCreateRadio("1",$left_s1 + 00, $top_3, 30, 20, $WS_GROUP)
    $RadioButtonGroups[2][1] = GUICtrlCreateRadio("2",$left_s1 + 30, $top_3, 30, 20)
    $RadioButtonGroups[2][2] = GUICtrlCreateRadio("3",$left_s1 + 60, $top_3, 30, 20)
    $RadioButtonGroups[2][3] = GUICtrlCreateRadio("4",$left_s1 + 90, $top_3, 30, 20)
    $RadioButtonGroups[2][4] = GUICtrlCreateRadio("5",$left_s1 + 120, $top_3, 30, 20)
    $RadioButtonGroups[2][5] = GUICtrlCreateRadio("6",$left_s1 + 150, $top_3, 30, 20)
    $edit3 = GUICtrlCreateEdit("", 90, 690, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    ;----------zweite spalte ----------------------------------------------
    GUICtrlCreateGroup("4. Hilfsbereitschaft ", 475, 150, $group_w, $group_h)
    $RadioButtonGroups[3][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_1, 30, 20, $WS_GROUP)
    $RadioButtonGroups[3][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_1, 30, 20)
    $RadioButtonGroups[3][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_1, 30, 20)
    $RadioButtonGroups[3][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_1, 30, 20)
    $RadioButtonGroups[3][4] = GUICtrlCreateRadio("5", $left_s2 + 120, $top_1, 30, 20)
    $RadioButtonGroups[3][5] = GUICtrlCreateRadio("6", $left_s2 + 150, $top_1, 30, 20)
    $edit4 = GUICtrlCreateEdit("", 495, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("5. Loyalität ", 475, 380, $group_w, $group_h)
    $RadioButtonGroups[4][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_2, 30, 20, $WS_GROUP)
    $RadioButtonGroups[4][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_2, 30, 20)
    $RadioButtonGroups[4][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_2, 30, 20)
    $RadioButtonGroups[4][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_2, 30, 20)
    $RadioButtonGroups[4][4] = GUICtrlCreateRadio("5", $left_s2 + 120,$top_2, 30, 20)
    $RadioButtonGroups[4][5] = GUICtrlCreateRadio("6", $left_s2 + 150,$top_2, 30, 20)
    $edit5 = GUICtrlCreateEdit("", 495, 465, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("6. Fähigkeit zum Vermitteln von Zusammenhängen ", 475, 610, $group_w, $group_h)
    $RadioButtonGroups[5][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_3, 30, 20, $WS_GROUP)
    $RadioButtonGroups[5][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_3, 30, 20)
    $RadioButtonGroups[5][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_3, 30, 20)
    $RadioButtonGroups[5][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_3, 30, 20)
    $RadioButtonGroups[5][4] = GUICtrlCreateRadio("5", $left_s2 + 120,$top_3, 30, 20)
    $RadioButtonGroups[5][5] = GUICtrlCreateRadio("6", $left_s2 + 150,$top_3, 30, 20)
    $edit6 = GUICtrlCreateEdit("", 495, 690, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    ;----------dritte spalte ----------------------------------------------
    GUICtrlCreateGroup("7. Motivation ", 880, 150, $group_w, $group_h)
    $RadioButtonGroups[6][0] = GUICtrlCreateRadio("1", $left_s3 + 00, $top_1, 30, 20, $WS_GROUP)
    $RadioButtonGroups[6][1] = GUICtrlCreateRadio("2", $left_s3 + 30, $top_1, 30, 20)
    $RadioButtonGroups[6][2] = GUICtrlCreateRadio("3", $left_s3 + 60, $top_1, 30, 20)
    $RadioButtonGroups[6][3] = GUICtrlCreateRadio("4", $left_s3 + 90, $top_1, 30, 20)
    $RadioButtonGroups[6][4] = GUICtrlCreateRadio("5", $left_s3 + 120, $top_1, 30, 20)
    $RadioButtonGroups[6][5] = GUICtrlCreateRadio("6", $left_s3 + 150, $top_1, 30, 20)
    $edit7 = GUICtrlCreateEdit("", 900, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("8. Was ist aus deiner Sicht besonders positiv? ", 880, 380, $group_w, $group_ht)
    $edit8 = GUICtrlCreateEdit("", 900, 410, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("9. Was ist aus deiner Sicht besonders negativ? ", 880, 560, $group_w, $group_ht)
    $edit9 = GUICtrlCreateEdit("", 900, 590, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("10. weitere Anmerkungen! ", 880, 740, $group_w, $group_ht)
    $edit10 = GUICtrlCreateEdit("", 900, 770, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    $Button_1 = GUICtrlCreateButton( "Formular Absenden",@DesktopWidth * (50 /100) -50,900,130,30, 0x0C00 )

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

    GUISetState()

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

    While 1
    $nMsg = GUIGetMsg()

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

    Switch $nMsg

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

    Case $GUI_EVENT_CLOSE
    Exit

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

    Case $TL_Combo

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

    Case $Button_1
    ;$wert_edit = ""
    Local $avArray[1] ;wenn nicht alle Felder gefüllt sind erstelle leeres Array ...

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

    If _pruefen( $RadioButtonGroups ) = True Then
    MsgBox(0,"1 alles ok", ":)" )
    $wert_TL = GUICtrlRead($TL_Combo)
    _ArrayAdd($avArray, $wert_TL)
    _ArrayDisplay($avArray)
    Exit
    Else
    MsgBox(0,"Info","Bitte alle Felder ausfüllen")
    EndIf

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

    EndSwitch
    WEnd

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

    ;
    ; Hier musst du natürlich noch die Überprüfung der Editboxen rein machen.
    ;
    Func _pruefen( $RadBtnGrps )

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

    Local $AllNeededDataFound = False

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

    If _check_all_Radio_Buttons_State( $RadBtnGrps ) = True Then
    $AllNeededDataFound = True

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

    Else
    $AllNeededDataFound = False
    Return $AllNeededDataFound
    EndIf

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

    Return $AllNeededDataFound
    EndFunc

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

    ;
    ; Prüft >>> alle <<< Radio Button Gruppen ob ein RadioButton gesetzt ist.
    ;
    Func _check_all_Radio_Buttons_State( $RadBtnGrps )
    Local $SizeOfRadBtnArr = UBound( $RadBtnGrps )
    Local $RadioButtonChecked = False

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

    For $Lc = 0 To $SizeOfRadBtnArr - 1
    If _is_Radio_Button_Of_Group_Checked( $RadBtnGrps, $Lc ) = True Then
    $RadioButtonChecked = True
    Else
    $RadioButtonChecked = False
    ExitLoop
    EndIf
    Next
    ;MsgBox(0,"",$RadioButtonChecked)
    Return $RadioButtonChecked
    EndFunc

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

    ;
    ; Prüft ob innerhalb einer RadioButton Gruppe ein Radio Button gestzt ist.
    ;
    Func _is_Radio_Button_Of_Group_Checked( $RadioButtonArray, $GroupNr )
    Local $SizeOfArray = UBound( $RadioButtonArray, 2 )
    Local $RadioButtonChecked = False

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

    For $Lc = 0 To $SizeOfArray - 1
    ;MsgBox(0,"",$Lc)
    If GUICtrlRead( $RadioButtonArray[$GroupNr][$Lc] ) = $GUI_CHECKED Then
    $RadioButtonChecked = True
    _ArrayAdd($avArray, $GroupNr + 1 & "|" & $Lc + 1)
    ExitLoop
    EndIf
    Next

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

    Return $RadioButtonChecked
    EndFunc

    [/autoit]

    Danke Vorab für die Unterstützung :)

    gruß gmmg

  • Pflichtfelder (Radio Button, Edit Feld) vor dem Absenden des Formulars auf Inhalt prüfen

    • gmmg
    • 7. November 2013 um 16:18

    Hallo Photon,

    danke für die Lösung und deine Mühe :o) Gefällt mir sehr gut!

    In meiner alten Version (folgend nochmal) habe ich die Daten gleich in ein Array (siehe Anhang Array.png) geschrieben, um die dann aus diesem weiterverarbeiten zu können!
    Zum Beispiel dann aus dem Array in eine DB oder Excel Sheet schreiben ...
    An welcher Stelle müsste man die Abfrage jetzt einbauen, um herauszufinden, welcher Radio Button aktiv ist, um die in ein Array zu schreiben?

    Wie könnte man das hier denn mit deiner Version (hab da mal noch paar Radios und Edit Felder ergänzt) lösen?

    neue Version ...

    Spoiler anzeigen
    [autoit][/autoit] [autoit][/autoit] [autoit]

    #include <Excel.au3>
    #include <Array.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

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

    Dim $x, $wert_edit, $radio_x1, $radio_x2, $radio_x3, $radio_x4,$radio_x5,$radio_x6
    Local $avArray[1]

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

    GUICreate("",@DesktopWidth,@DesktopHeight,0,0, $WS_OVERLAPPEDWINDOW) ; will create a dialog box that when displayed is centered
    $TL_Combo = GUICtrlCreateCombo("",600, 100,100,20) ; create first item
    $Label_1 = GUICtrlCreateLabel("Feedback an die Teamleitung und das Qualitätsmanagement",260,30,@DesktopWidth,50)
    GUICtrlSetFont($Label_1,22,120, 0, "Arial")
    GUICtrlSetData($TL_Combo, "Teamleiter1|Teamleiter2|Teamleiter3|Teamleiter4|Teamleiter5", "Teamleiter1") ; add other item snd set a new default
    ;----------erste spalte ----------------------------------------------
    $top_1 = 190
    $top_2 = 420
    $top_3 = 640
    $left_s1 = 100
    $left_s2 = 510
    $left_s3 = 920
    $group_w = 350
    $group_h = 200
    $group_ht = 150

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

    Global $RadioButtonGroups[7][7]

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

    GUICtrlCreateGroup("1. Objektivität / Fairness ", 70, 150, $group_w, $group_h)
    $RadioButtonGroups[0][0] = GUICtrlCreateRadio( "1", $left_s1 + 00,$top_1, 30, 20, $WS_GROUP)
    $RadioButtonGroups[0][1] = GUICtrlCreateRadio( "2", $left_s1 + 30,$top_1, 30, 20)
    $RadioButtonGroups[0][2] = GUICtrlCreateRadio( "3", $left_s1 + 60,$top_1, 30, 20)
    $RadioButtonGroups[0][3] = GUICtrlCreateRadio( "4", $left_s1 + 90,$top_1, 30, 20)
    $RadioButtonGroups[0][4] = GUICtrlCreateRadio( "5", $left_s1 + 120,$top_1, 30, 20)
    $RadioButtonGroups[0][5] = GUICtrlCreateRadio( "6", $left_s1 + 150,$top_1, 30, 20)
    $edit11 = GUICtrlCreateEdit("", 90, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("2. Kompetenz in seiner Aufgabe ", 70, 380, $group_w, $group_h)
    $RadioButtonGroups[1][0] = GUICtrlCreateRadio("1",$left_s1 + 00, $top_2, 30, 20, $WS_GROUP)
    $RadioButtonGroups[1][1] = GUICtrlCreateRadio("2",$left_s1 + 30, $top_2, 30, 20)
    $RadioButtonGroups[1][2] = GUICtrlCreateRadio("3",$left_s1 + 60, $top_2, 30, 20)
    $RadioButtonGroups[1][3] = GUICtrlCreateRadio("4",$left_s1 + 90, $top_2, 30, 20)
    $RadioButtonGroups[1][4] = GUICtrlCreateRadio("5",$left_s1 + 120, $top_2, 30, 20)
    $RadioButtonGroups[1][5] = GUICtrlCreateRadio("6",$left_s1 + 150, $top_2, 30, 20)
    $edit21 = GUICtrlCreateEdit("", 90, 465, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("3. Verständnis für Anliegen/Probleme ", 70, 610, $group_w, $group_h)
    $RadioButtonGroups[2][0] = GUICtrlCreateRadio("1",$left_s1 + 00, $top_3, 30, 20, $WS_GROUP)
    $RadioButtonGroups[2][1] = GUICtrlCreateRadio("2",$left_s1 + 30, $top_3, 30, 20)
    $RadioButtonGroups[2][2] = GUICtrlCreateRadio("3",$left_s1 + 60, $top_3, 30, 20)
    $RadioButtonGroups[2][3] = GUICtrlCreateRadio("4",$left_s1 + 90, $top_3, 30, 20)
    $RadioButtonGroups[2][4] = GUICtrlCreateRadio("5",$left_s1 + 120, $top_3, 30, 20)
    $RadioButtonGroups[2][5] = GUICtrlCreateRadio("6",$left_s1 + 150, $top_3, 30, 20)
    $edit31 = GUICtrlCreateEdit("", 90, 690, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    ;----------zweite spalte ----------------------------------------------
    GUICtrlCreateGroup("4. Hilfsbereitschaft ", 475, 150, $group_w, $group_h)
    $RadioButtonGroups[3][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_1, 30, 20, $WS_GROUP)
    $RadioButtonGroups[3][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_1, 30, 20)
    $RadioButtonGroups[3][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_1, 30, 20)
    $RadioButtonGroups[3][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_1, 30, 20)
    $RadioButtonGroups[3][4] = GUICtrlCreateRadio("5", $left_s2 + 120, $top_1, 30, 20)
    $RadioButtonGroups[3][5] = GUICtrlCreateRadio("6", $left_s2 + 150, $top_1, 30, 20)
    $edit41 = GUICtrlCreateEdit("", 495, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("5. Loyalität ", 475, 380, $group_w, $group_h)
    $RadioButtonGroups[4][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_2, 30, 20, $WS_GROUP)
    $RadioButtonGroups[4][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_2, 30, 20)
    $RadioButtonGroups[4][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_2, 30, 20)
    $RadioButtonGroups[4][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_2, 30, 20)
    $RadioButtonGroups[4][4] = GUICtrlCreateRadio("5", $left_s2 + 120,$top_2, 30, 20)
    $RadioButtonGroups[4][5] = GUICtrlCreateRadio("6", $left_s2 + 150,$top_2, 30, 20)
    $edit51 = GUICtrlCreateEdit("", 495, 465, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("6. Fähigkeit zum Vermitteln von Zusammenhängen ", 475, 610, $group_w, $group_h)
    $RadioButtonGroups[5][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_3, 30, 20, $WS_GROUP)
    $RadioButtonGroups[5][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_3, 30, 20)
    $RadioButtonGroups[5][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_3, 30, 20)
    $RadioButtonGroups[5][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_3, 30, 20)
    $RadioButtonGroups[5][4] = GUICtrlCreateRadio("5", $left_s2 + 120,$top_3, 30, 20)
    $RadioButtonGroups[5][5] = GUICtrlCreateRadio("6", $left_s2 + 150,$top_3, 30, 20)
    $edit61 = GUICtrlCreateEdit("", 495, 690, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    ;----------dritte spalte ----------------------------------------------
    GUICtrlCreateGroup("7. Motivation ", 880, 150, $group_w, $group_h)
    $RadioButtonGroups[6][0] = GUICtrlCreateRadio("1", $left_s3 + 00, $top_1, 30, 20, $WS_GROUP)
    $RadioButtonGroups[6][1] = GUICtrlCreateRadio("2", $left_s3 + 30, $top_1, 30, 20)
    $RadioButtonGroups[6][2] = GUICtrlCreateRadio("3", $left_s3 + 60, $top_1, 30, 20)
    $RadioButtonGroups[6][3] = GUICtrlCreateRadio("4", $left_s3 + 90, $top_1, 30, 20)
    $RadioButtonGroups[6][4] = GUICtrlCreateRadio("5", $left_s3 + 120, $top_1, 30, 20)
    $RadioButtonGroups[6][5] = GUICtrlCreateRadio("6", $left_s3 + 150, $top_1, 30, 20)
    $edit71 = GUICtrlCreateEdit("", 900, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("8. Was ist aus deiner Sicht besonders positiv? ", 880, 380, $group_w, $group_ht)
    $edit81 = GUICtrlCreateEdit("", 900, 410, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("9. Was ist aus deiner Sicht besonders negativ? ", 880, 560, $group_w, $group_ht)
    $edit91 = GUICtrlCreateEdit("", 900, 590, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("10. weitere Anmerkungen! ", 880, 740, $group_w, $group_ht)
    $edit101 = GUICtrlCreateEdit("", 900, 770, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    $Button_1 = GUICtrlCreateButton( "Formular Absenden",@DesktopWidth * (50 /100) -50,900,130,30, 0x0C00 )

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

    GUISetState()

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

    While 1
    $nMsg = GUIGetMsg()

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

    Switch $nMsg

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

    Case $GUI_EVENT_CLOSE
    Exit

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

    Case $TL_Combo

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

    Case $Button_1
    If _pruefen( $RadioButtonGroups ) = True Then
    MsgBox(0,"1 alles ok", ":)" )
    Exit
    Else
    MsgBox(0,"Info","Bitte alle Felder ausfüllen")
    EndIf

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

    EndSwitch
    WEnd

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

    ;
    ; Hier musst du natürlich noch die Überprüfung der Editboxen rein machen.
    ;
    Func _pruefen( $RadBtnGrps )

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

    Local $AllNeededDataFound = False

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

    If _check_all_Radio_Buttons_State( $RadBtnGrps ) = True Then
    $AllNeededDataFound = True
    Else
    $AllNeededDataFound = False
    Return $AllNeededDataFound
    EndIf

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

    Return $AllNeededDataFound
    EndFunc

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

    ;
    ; Prüft >>> alle <<< Radio Button Gruppen ob ein RadioButton gesetzt ist.
    ;
    Func _check_all_Radio_Buttons_State( $RadBtnGrps )
    Local $SizeOfRadBtnArr = UBound( $RadBtnGrps )
    Local $RadioButtonChecked = False

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

    For $Lc = 0 To $SizeOfRadBtnArr - 1
    If _is_Radio_Button_Of_Group_Checked( $RadBtnGrps, $Lc ) = True Then
    $RadioButtonChecked = True
    Else
    $RadioButtonChecked = False
    ExitLoop
    EndIf
    Next

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

    Return $RadioButtonChecked
    EndFunc

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

    ;
    ; Prüft ob innerhalb einer RadioButton Gruppe ein Radio Button gestzt ist.
    ;
    Func _is_Radio_Button_Of_Group_Checked( $RadioButtonArray, $GroupNr )
    Local $SizeOfArray = UBound( $RadioButtonArray, 2 )
    Local $RadioButtonChecked = False

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

    For $Lc = 0 To $SizeOfArray - 1
    If GUICtrlRead( $RadioButtonArray[$GroupNr][$Lc] ) = $GUI_CHECKED Then
    $RadioButtonChecked = True
    ExitLoop
    EndIf
    Next

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

    Return $RadioButtonChecked
    EndFunc

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


    alte Version ...

    Spoiler anzeigen
    [autoit][/autoit] [autoit][/autoit] [autoit]

    #include <Excel.au3>
    #include <Array.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

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

    Dim $x, $wert_edit, $radio_x1, $radio_x2, $radio_x3, $radio_x4,$radio_x5,$radio_x6
    Local $avArray[1]

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

    GUICreate("",@DesktopWidth,@DesktopHeight,0,0,0x80000000) ; will create a dialog box that when displayed is centered
    $label_1 = GUICtrlCreateLabel("Feedback an die Teamleitung und das Qualitätsmanagement",260,30,@DesktopWidth,50)
    GUICtrlSetFont($Label_1,22,120, 0, "Arial")
    $label_2 = GUICtrlCreateLabel("Ansprechpartner, der bewertet werden soll: ",390,103,300,20);
    $TL_Combo = GUICtrlCreateCombo("",600, 100,100,20) ; create first item
    GUICtrlSetData($TL_Combo, "Teamleiter1|Teamleiter2|Teamleiter3|Teamleiter4|Teamleiter5", "Teamleiter1") ; add other item snd set a new default
    ;----------erste spalte ----------------------------------------------
    $top_1 = 190
    $top_2 = 420
    $top_3 = 640
    $left_s1 = 100
    $left_s2 = 510
    $left_s3 = 920
    $group_w = 350
    $group_h = 200
    $group_ht = 150

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

    GUICtrlCreateGroup("1. Objektivität / Fairness ", 70, 150, $group_w, $group_h)
    $radio11 = GUICtrlCreateRadio("1",$left_s1 + 00,$top_1, 30, 20, $WS_GROUP)
    $radio12 = GUICtrlCreateRadio("2",$left_s1 + 30,$top_1, 30, 20)
    $radio13 = GUICtrlCreateRadio("3",$left_s1 + 60,$top_1, 30, 20)
    $radio14 = GUICtrlCreateRadio("4",$left_s1 + 90,$top_1, 30, 20)
    $radio15 = GUICtrlCreateRadio("5",$left_s1 + 120,$top_1, 30, 20)
    $radio16 = GUICtrlCreateRadio("6",$left_s1 + 150,$top_1, 30, 20)
    $edit11 = GUICtrlCreateEdit("", 90, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("2. Kompetenz in seiner Aufgabe ", 70, 380, $group_w, $group_h)
    $radio21 = GUICtrlCreateRadio("1",$left_s1 + 00, $top_2, 30, 20, $WS_GROUP)
    $radio22 = GUICtrlCreateRadio("2",$left_s1 + 30, $top_2, 30, 20)
    $radio23 = GUICtrlCreateRadio("3",$left_s1 + 60, $top_2, 30, 20)
    $radio24 = GUICtrlCreateRadio("4",$left_s1 + 90, $top_2, 30, 20)
    $radio25 = GUICtrlCreateRadio("5",$left_s1 + 120, $top_2, 30, 20)
    $radio26 = GUICtrlCreateRadio("6",$left_s1 + 150, $top_2, 30, 20)
    $edit21 = GUICtrlCreateEdit("", 90, 465, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("3. Verständnis für Anliegen/Probleme ", 70, 610, $group_w, $group_h)
    $radio31 = GUICtrlCreateRadio("1",$left_s1 + 00, $top_3, 30, 20, $WS_GROUP)
    $radio32 = GUICtrlCreateRadio("2",$left_s1 + 30, $top_3, 30, 20)
    $radio33 = GUICtrlCreateRadio("3",$left_s1 + 60, $top_3, 30, 20)
    $radio34 = GUICtrlCreateRadio("4",$left_s1 + 90, $top_3, 30, 20)
    $radio35 = GUICtrlCreateRadio("5",$left_s1 + 120, $top_3, 30, 20)
    $radio36 = GUICtrlCreateRadio("6",$left_s1 + 150, $top_3, 30, 20)
    $edit31 = GUICtrlCreateEdit("", 90, 690, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group
    ;----------zweite spalte ----------------------------------------------
    GUICtrlCreateGroup("4. Hilfsbereitschaft ", 475, 150, $group_w, $group_h)
    $radio41 = GUICtrlCreateRadio("1", $left_s2 + 00, $top_1, 30, 20, $WS_GROUP)
    $radio42 = GUICtrlCreateRadio("2", $left_s2 + 30, $top_1, 30, 20)
    $radio43 = GUICtrlCreateRadio("3", $left_s2 + 60, $top_1, 30, 20)
    $radio44 = GUICtrlCreateRadio("4", $left_s2 + 90, $top_1, 30, 20)
    $radio45 = GUICtrlCreateRadio("5", $left_s2 + 120, $top_1, 30, 20)
    $radio46 = GUICtrlCreateRadio("6", $left_s2 + 150, $top_1, 30, 20)
    $edit41 = GUICtrlCreateEdit("", 495, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("5. Loyalität ", 475, 380, $group_w, $group_h)
    $radio51 = GUICtrlCreateRadio("1", $left_s2 + 00, $top_2, 30, 20, $WS_GROUP)
    $radio52 = GUICtrlCreateRadio("2", $left_s2 + 30, $top_2, 30, 20)
    $radio53 = GUICtrlCreateRadio("3", $left_s2 + 60, $top_2, 30, 20)
    $radio54 = GUICtrlCreateRadio("4", $left_s2 + 90, $top_2, 30, 20)
    $radio55 = GUICtrlCreateRadio("5", $left_s2 + 120,$top_2, 30, 20)
    $radio56 = GUICtrlCreateRadio("6", $left_s2 + 150,$top_2, 30, 20)
    $edit51 = GUICtrlCreateEdit("", 495, 465, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("6. Fähigkeit zum Vermitteln von Zusammenhängen ", 475, 610, $group_w, $group_h)
    $radio61 = GUICtrlCreateRadio("1", $left_s2 + 00, $top_3, 30, 20, $WS_GROUP)
    $radio62 = GUICtrlCreateRadio("2", $left_s2 + 30, $top_3, 30, 20)
    $radio63 = GUICtrlCreateRadio("3", $left_s2 + 60, $top_3, 30, 20)
    $radio64 = GUICtrlCreateRadio("4", $left_s2 + 90, $top_3, 30, 20)
    $radio65 = GUICtrlCreateRadio("5", $left_s2 + 120,$top_3, 30, 20)
    $radio66 = GUICtrlCreateRadio("6", $left_s2 + 150,$top_3, 30, 20)
    $edit61 = GUICtrlCreateEdit("", 495, 690, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    ;----------dritte spalte ----------------------------------------------
    GUICtrlCreateGroup("7. Motivation ", 880, 150, $group_w, $group_h)
    $radio71 = GUICtrlCreateRadio("1", $left_s3 + 00, $top_1, 30, 20, $WS_GROUP)
    $radio72 = GUICtrlCreateRadio("2", $left_s3 + 30, $top_1, 30, 20)
    $radio73 = GUICtrlCreateRadio("3", $left_s3 + 60, $top_1, 30, 20)
    $radio74 = GUICtrlCreateRadio("4", $left_s3 + 90, $top_1, 30, 20)
    $radio75 = GUICtrlCreateRadio("5", $left_s3 + 120, $top_1, 30, 20)
    $radio76 = GUICtrlCreateRadio("6", $left_s3 + 150, $top_1, 30, 20)
    $edit71 = GUICtrlCreateEdit("", 900, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("8. Was ist aus deiner Sicht besonders positiv? ", 880, 380, $group_w, $group_ht)
    $edit81 = GUICtrlCreateEdit("", 900, 410, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("9. Was ist aus deiner Sicht besonders negativ? ", 880, 560, $group_w, $group_ht)
    $edit91 = GUICtrlCreateEdit("", 900, 590, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("10. weitere Anmerkungen! ", 880, 740, $group_w, $group_ht)
    $edit101 = GUICtrlCreateEdit("", 900, 770, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    $Button_1 = GUICtrlCreateButton("Formular Absenden",@DesktopWidth * (50 /100) -50,900,130,30, 0x0C00)

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

    GUISetState()

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

    While 1
    $nMsg = GUIGetMsg()

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

    Switch $nMsg

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

    Case $GUI_EVENT_CLOSE
    Exit

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

    Case $TL_Combo

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

    Case $Button_1
    $feld = ""
    _pruefen()

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

    IF $feld = "leer" Then
    MsgBox(0,"Info","...Bitte alle Felder ausfüllen!...")
    ;_ArrayDisplay($avArray)
    Local $avArray[1] ;wenn nicht alle Felder gefüllt sind erstelle leeres Array ...
    ;_ArrayDisplay($avArray)
    Else
    MsgBox(0,"1 alles ok",$feld)
    _ArrayDisplay($avArray)
    Exit
    EndIf

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

    EndSwitch
    WEnd

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

    Func _pruefen()

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

    $wert_TL = GUICtrlRead($TL_Combo)
    _ArrayAdd($avArray, $wert_TL)

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

    _radio_edit($radio11, $radio12, $radio13, $radio14, $radio15, $radio16, $edit11)
    _radio_edit($radio21, $radio22, $radio23, $radio24, $radio25, $radio26, $edit21)
    _radio_edit($radio31, $radio32, $radio33, $radio34, $radio35, $radio36, $edit31)
    _radio_edit($radio41, $radio42, $radio43, $radio44, $radio45, $radio46, $edit41)
    _radio_edit($radio51, $radio52, $radio53, $radio54, $radio55, $radio56, $edit51)
    _radio_edit($radio61, $radio62, $radio63, $radio64, $radio65, $radio66, $edit61)
    _radio_edit($radio71, $radio72, $radio73, $radio74, $radio75, $radio76, $edit71)
    _radio_edit("no_rb","no_rb","no_rb","no_rb","no_rb","no_rb", $edit81)
    _radio_edit("no_rb","no_rb","no_rb","no_rb","no_rb","no_rb", $edit91)
    _radio_edit("no_rb","no_rb","no_rb","no_rb","no_rb","no_rb", $edit101)

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

    $feld = ""
    _ArraySearch($avArray, "leer")

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

    If @error Then
    ;MsgBox(0, "Not Found", 'was not found in the array.')
    Else
    ;MsgBox(0, "Found", 'was found in the array at position ')
    $feld = "leer"
    EndIf

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

    Return $feld
    EndFunc

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

    Func _radio_edit($radio_x1,$radio_x2, $radio_x3 , $radio_x4, $radio_x5, $radio_x6, $edit_x)

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

    $x = ""
    $wert_edit = ""

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

    $wert_edit = GUICtrlRead($edit_x)

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

    ; Group mit $radio1 bis $radio6
    For $i = $radio_x1 To $radio_x6
    If GUICtrlRead($i) = 1 Then ;$GUI_CHECKED Then
    Switch $i
    Case $radio_x1
    $x = 1
    Case $radio_x2
    $x = 2
    Case $radio_x3
    $x = 3
    Case $radio_x4
    $x = 4
    Case $radio_x5
    $x = 5
    Case $radio_x6
    $x = 6
    EndSwitch
    ExitLoop
    EndIf
    Next

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

    ;Return $x & $wert_edit

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

    If $x = "" or $wert_edit = "" or $radio_x1 = "no_rb" And $wert_edit = "" Then
    _ArrayAdd($avArray, "leer")
    Else
    _ArrayAdd($avArray, $x & "|" & $wert_edit)
    EndIf

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

    EndFunc

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

    Func _set_entries($TL)
    $z = 0
    Local $sFilePath1 = @ScriptDir & "\TL_Bewertung.xlsx" ;This file should already exist
    Local $oExcel = _ExcelBookOpen($sFilePath1)

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

    If @error = 1 Then
    MsgBox(0, "Error!", "Unable to Create the Excel Object")
    Exit
    ElseIf @error = 2 Then
    MsgBox(0, "Error!", "File does not exist - Shame on you!")
    Exit
    EndIf

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

    $aArray = _ExcelSheetList($oExcel)
    ;_ArrayDisplay($aArray)
    Local $iIndex = _ArraySearch($aArray, $TL, 0, 0, 0, 1)
    If @error Then
    ;MsgBox(0, "Not Found", 'was not found in the array.')
    _ExcelSheetAddNew($oExcel, $TL)
    $aArray = _ExcelSheetList($oExcel)
    ;_ArrayDisplay($aArray)
    Else
    ;MsgBox(0, "Found", 'was found in the array at position ' & $iIndex & ".")
    EndIf

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

    For $i = $aArray[0] To 1 Step -1 ;Work backwards through loop

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

    IF $aArray[$i] = $TL Then

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

    _ExcelSheetActivate($oExcel, $aArray[$i]) ;Using the String Name returned in the Array Elements
    MsgBox(0, "ActiveSheet", "The Active Sheet should be:" & @CRLF & $aArray[$i])
    _ExcelRowInsert($oExcel, 2, 1) ;Insert 1 Row at row 1
    _ExcelWriteCell($oExcel, "OT4M", 2, 1) ;Write to the Cell
    _ExcelWriteCell($oExcel, "Bewertung33", 2, 2) ;Write to the Cell
    $z = 1
    ExitLoop
    EndIf
    Next
    ;~ If $z = 0 then
    ;~ _ExcelSheetAddNew($oExcel, $TL)
    ;~ _ExcelSheetActivate($oExcel,$TL) ;Using the String Name returned in the Array Elements
    ;~ MsgBox(0, "ActiveSheet", "The Active Sheet should be:" & @CRLF & $aArray[$i])
    ;~ _ExcelRowInsert($oExcel, 2, 1) ;Insert 1 Row at row 1
    ;~ _ExcelWriteCell($oExcel, @username, 2, 1) ;Write to the Cell
    ;~ _ExcelWriteCell($oExcel, "Bewertung3", 2, 2) ;Write to the Cell
    ;~ EndIf
    _ExcelBookClose($oExcel, 1, 0)

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

    EndFunc

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

    Danke

    gruß gmmg :thumbup:

    Dateien

    Array.PNG 74,49 kB – 0 Downloads
  • Pflichtfelder (Radio Button, Edit Feld) vor dem Absenden des Formulars auf Inhalt prüfen

    • gmmg
    • 6. November 2013 um 14:59

    Hallo Photon,

    das mit der Auflösung ist noch nicht angepasst ...
    Habe aber meine Abfrage, ob alle Felder gefüllt sind mal gebastelt!

    Ich schreibe praktisch die werte in ein Array, wenn hier ein Feld oder eine Radio nicht aktiviert wurde, wird ins Array ein Wert "leer" geschrieben!
    Nun prüfe ich mit ArraySearch ob im Array ein Eintrag mit " leer" vorkommt! Wenn es vorkommt, wird das Array neu leer erzeugt und das Ganze wird neu geprüft, bis alle Felder gefüllt sind, erst dann geht es weiter im script ... :)

    [autoit]


    IF $feld = "leer" Then
    MsgBox(0,"Info","Bitte alle Felder ausfüllen")
    ;_ArrayDisplay($avArray)
    Local $avArray[1] ;wenn nicht alle Felder gefüllt sind erstelle leeres Array ...
    Else
    MsgBox(0,"1 alles ok",$feld)
    ;_ArrayDisplay($avArray)
    Exit --> hier geht es dann weiter --> Daten in DB schreiben etc ...
    EndIf

    [/autoit]


    Spoiler anzeigen
    [autoit]


    #include <Excel.au3>
    #include <Array.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

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

    Dim $x, $wert_edit, $radio_x1, $radio_x2, $radio_x3, $radio_x4,$radio_x5,$radio_x6
    Local $avArray[1]

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

    GUICreate("",@DesktopWidth,@DesktopHeight,0,0,0x80000000) ; will create a dialog box that when displayed is centered
    $TL_Combo = GUICtrlCreateCombo("",600, 100,100,20) ; create first item
    $Label_1 = GUICtrlCreateLabel("Feedback an die Teamleitung und das Qualitätsmanagement",260,30,@DesktopWidth,50)
    GUICtrlSetFont($Label_1,22,120, 0, "Arial")
    GUICtrlSetData($TL_Combo, "Teamleiter1|Teamleiter2|Teamleiter3|Teamleiter4|Teamleiter5", "Teamleiter1") ; add other item snd set a new default
    ;----------erste spalte ----------------------------------------------
    $top_1 = 190
    $top_2 = 420
    $top_3 = 640
    $left_s1 = 110
    $left_s2 = 530

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

    GUICtrlCreateGroup("1. Objektivität / Fairness 1 ", 90, 150, 400, 200)
    $radio11 = GUICtrlCreateRadio("1",$left_s1 + 00,$top_1, 30, 20, $WS_GROUP)
    $radio12 = GUICtrlCreateRadio("2",$left_s1 + 30,$top_1, 30, 20)
    $radio13 = GUICtrlCreateRadio("3",$left_s1 + 60,$top_1, 30, 20)
    $radio14 = GUICtrlCreateRadio("4",$left_s1 + 90,$top_1, 30, 20)
    $radio15 = GUICtrlCreateRadio("5",$left_s1 + 120,$top_1, 30, 20)
    $radio16 = GUICtrlCreateRadio("6",$left_s1 + 150,$top_1, 30, 20)
    $edit11 = GUICtrlCreateEdit("", 110, 235, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("2. Objektivität / Fairness 2 ", 90, 380, 400, 200)
    $radio21 = GUICtrlCreateRadio("1",$left_s1 + 00, $top_2, 30, 20, $WS_GROUP)
    $radio22 = GUICtrlCreateRadio("2",$left_s1 + 30, $top_2, 30, 20)
    $radio23 = GUICtrlCreateRadio("3",$left_s1 + 60, $top_2, 30, 20)
    $radio24 = GUICtrlCreateRadio("4",$left_s1 + 90, $top_2, 30, 20)
    $radio25 = GUICtrlCreateRadio("5",$left_s1 + 120, $top_2, 30, 20)
    $radio26 = GUICtrlCreateRadio("6",$left_s1 + 150, $top_2, 30, 20)
    $edit21 = GUICtrlCreateEdit("", 110, 465, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("3. Objektivität / Fairness 3 ", 90, 610, 400, 200)
    $radio31 = GUICtrlCreateRadio("1",$left_s1 + 00, $top_3, 30, 20, $WS_GROUP)
    $radio32 = GUICtrlCreateRadio("2",$left_s1 + 30, $top_3, 30, 20)
    $radio33 = GUICtrlCreateRadio("3",$left_s1 + 60, $top_3, 30, 20)
    $radio34 = GUICtrlCreateRadio("4",$left_s1 + 90, $top_3, 30, 20)
    $radio35 = GUICtrlCreateRadio("5",$left_s1 + 120, $top_3, 30, 20)
    $radio36 = GUICtrlCreateRadio("6",$left_s1 + 150, $top_3, 30, 20)
    $edit31 = GUICtrlCreateEdit("", 110, 690, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group
    ;----------zweite spalte ----------------------------------------------
    GUICtrlCreateGroup("4. Objektivität / Fairness 4 ", 510, 150, 400, 200)
    $radio41 = GUICtrlCreateRadio("1", $left_s2 + 00, $top_1, 30, 20, $WS_GROUP)
    $radio42 = GUICtrlCreateRadio("2", $left_s2 + 30, $top_1, 30, 20)
    $radio43 = GUICtrlCreateRadio("3", $left_s2 + 60, $top_1, 30, 20)
    $radio44 = GUICtrlCreateRadio("4", $left_s2 + 90, $top_1, 30, 20)
    $radio45 = GUICtrlCreateRadio("5", $left_s2 + 120, $top_1, 30, 20)
    $radio46 = GUICtrlCreateRadio("6", $left_s2 + 150, $top_1, 30, 20)
    $edit41 = GUICtrlCreateEdit("", 530, 235, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("5. Objektivität / Fairness 5 ", 510, 380, 400, 200)
    $radio51 = GUICtrlCreateRadio("1", $left_s2 + 00, $top_2, 30, 20, $WS_GROUP)
    $radio52 = GUICtrlCreateRadio("2", $left_s2 + 30, $top_2, 30, 20)
    $radio53 = GUICtrlCreateRadio("3", $left_s2 + 60, $top_2, 30, 20)
    $radio54 = GUICtrlCreateRadio("4", $left_s2 + 90, $top_2, 30, 20)
    $radio55 = GUICtrlCreateRadio("5", $left_s2 + 120,$top_2, 30, 20)
    $radio56 = GUICtrlCreateRadio("6", $left_s2 + 150,$top_2, 30, 20)
    $edit51 = GUICtrlCreateEdit("", 530, 465, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUICtrlCreateGroup("6. Objektivität / Fairness 6 ", 510, 610, 400, 200)
    $radio61 = GUICtrlCreateRadio("1", $left_s2 + 00, $top_3, 30, 20, $WS_GROUP)
    $radio62 = GUICtrlCreateRadio("2", $left_s2 + 30, $top_3, 30, 20)
    $radio63 = GUICtrlCreateRadio("3", $left_s2 + 60, $top_3, 30, 20)
    $radio64 = GUICtrlCreateRadio("4", $left_s2 + 90, $top_3, 30, 20)
    $radio65 = GUICtrlCreateRadio("5", $left_s2 + 120,$top_3, 30, 20)
    $radio66 = GUICtrlCreateRadio("6", $left_s2 + 150,$top_3, 30, 20)
    $edit61 = GUICtrlCreateEdit("", 530, 690, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    $Button_1 = GUICtrlCreateButton("Formular Absenden",@DesktopWidth * (50 /100) -50,900,130,30, 0x0C00)

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

    GUISetState()

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

    While 1
    $nMsg = GUIGetMsg()

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

    Switch $nMsg

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

    Case $GUI_EVENT_CLOSE
    Exit

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

    Case $TL_Combo

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

    Case $Button_1
    $feld = ""
    _pruefen()

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

    IF $feld = "leer" Then
    MsgBox(0,"Info","Bitte alle Felder ausfüllen")
    ;_ArrayDisplay($avArray)
    Local $avArray[1] ;wenn nicht alle Felder gefüllt sind erstelle leeres Array ...
    Else
    MsgBox(0,"1 alles ok",$feld)
    ;_ArrayDisplay($avArray)
    Exit
    EndIf

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

    EndSwitch
    WEnd

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

    Func _pruefen()

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

    $wert_TL = GUICtrlRead($TL_Combo)
    _ArrayAdd($avArray, $wert_TL)

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

    _radio_edit($radio11, $radio12, $radio13, $radio14, $radio15, $radio16, $edit11)
    _radio_edit($radio21, $radio22, $radio23, $radio24, $radio25, $radio26, $edit21)
    _radio_edit($radio31, $radio32, $radio33, $radio34, $radio35, $radio36, $edit31)
    _radio_edit($radio41, $radio42, $radio43, $radio44, $radio45, $radio46, $edit41)
    _radio_edit($radio51, $radio52, $radio53, $radio54, $radio55, $radio56, $edit51)
    _radio_edit($radio61, $radio62, $radio63, $radio64, $radio65, $radio66, $edit61)
    ;_radio_edit($radio31, $radio32, $radio33, $radio34, $radio35, $radio36, $edit31)

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

    $feld = ""
    _ArraySearch($avArray, "leer")

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

    If @error Then
    ;MsgBox(0, "Not Found", 'was not found in the array.')
    Else
    ;MsgBox(0, "Found", 'was found in the array at position ')
    $feld = "leer"
    EndIf

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

    Return $feld
    EndFunc

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

    Func _radio_edit($radio_x1,$radio_x2, $radio_x3 , $radio_x4, $radio_x5, $radio_x6, $edit_x)

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

    $x = ""
    $wert_edit = ""

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

    $wert_edit = GUICtrlRead($edit_x)

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

    ; Group mit $radio1 bis $radio6
    For $i = $radio_x1 To $radio_x6
    If GUICtrlRead($i) = 1 Then;$GUI_CHECKED Then
    Switch $i
    Case $radio_x1
    $x = 1
    Case $radio_x2
    $x = 2
    Case $radio_x3
    $x = 3
    Case $radio_x4
    $x = 4
    Case $radio_x5
    $x = 5
    Case $radio_x6
    $x = 6
    EndSwitch
    ExitLoop
    EndIf
    Next

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

    If $x = "" or $wert_edit = "" Then
    _ArrayAdd($avArray, "leer")
    Else
    _ArrayAdd($avArray, $x & "|" & $wert_edit)
    EndIf

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

    EndFunc

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

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™