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 ... ![]()
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
Spoiler anzeigen
#include <Excel.au3>
#include <Array.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Dim $x, $wert_edit, $radio_x1, $radio_x2, $radio_x3, $radio_x4,$radio_x5,$radio_x6
Local $avArray[1]
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
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
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
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
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
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
$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()
Switch $nMsg
[/autoit] [autoit][/autoit] [autoit]Case $GUI_EVENT_CLOSE
Exit
Case $TL_Combo
[/autoit] [autoit][/autoit] [autoit]Case $Button_1
$feld = ""
_pruefen()
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
EndSwitch
WEnd
Func _pruefen()
[/autoit] [autoit][/autoit] [autoit]$wert_TL = GUICtrlRead($TL_Combo)
_ArrayAdd($avArray, $wert_TL)
_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)
$feld = ""
_ArraySearch($avArray, "leer")
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
Return $feld
EndFunc
Func _radio_edit($radio_x1,$radio_x2, $radio_x3 , $radio_x4, $radio_x5, $radio_x6, $edit_x)
[/autoit] [autoit][/autoit] [autoit]$x = ""
$wert_edit = ""
$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
If $x = "" or $wert_edit = "" Then
_ArrayAdd($avArray, "leer")
Else
_ArrayAdd($avArray, $x & "|" & $wert_edit)
EndIf
EndFunc
[/autoit] [autoit][/autoit] [autoit][/autoit]