#include #include #include #include $gGUI = GUICreate("All Posibilities", 100, 65);GUI Stuff $l1Label = GUICtrlCreateLabel("3",10,3,25,15) $l2Label = GUICtrlCreateLabel("0/0",0,50,100,15,$SS_CENTER) $b1Button = GUICtrlCreateButton("Start", 0,30,100,20) $p1Prog = GUICtrlCreateProgress(0,20,100,10) $b2Button = GUICtrlCreateButton("Add Arrays",25,0,75,20) GUISetState(@SW_SHOW,$gGUI) Global $Arrayoarray[0][0];Setting Global Array for the combinations. Func Startproc() GUICtrlSetData($l1Label,3);Time Delay $prog = 0 Sleep(1000) GUICtrlSetData($l1Label,2) Sleep(1000) GUICtrlSetData($l1Label,1) Sleep(1000) GUICtrlSetData($l1Label,0) Local $y[0];Define the Counter Array Local $hld;Place Holder For $i = 0 to Ubound($Arrayoarray,2)-1;Set Default Vaules of Counter Array to 0 _ArrayAdd($y,0) Next Local $Count = 1 ;Set The total Count of the possiblities For $i = 0 to Ubound($Arrayoarray,2)-1 $Count = $Count* Ubound($Arrayoarray,1) Next For $i =1 to $Count ; main loop for combinations $hld = ""; reseting holder variable to "" For $k = 0 to Ubound($y)-1 ; Check if the combination has blank characters(happens with different sized columns) If $Arrayoarray[$y[$k]][$k] = "" Then $hld = $hld&"~";Adds a ~ if is blank $hld = $hld&$Arrayoarray[$y[$k]][$k];Combines the contents of the main Array into the holder variable Next If StringInStr($hld,"~")=0 Then; Checks for a ~ in the holder variable Send($hld) ; If no ~ in holder variable types the Holder Variable and ENTER Send("{ENTER}") EndIf If _IsPressed("1B") Then ExitLoop ; If ESC pressed exits loop $y[UBound($y)-1] = $y[UBound($y)-1]+1; Adds 1 to the rightmost index of the counter array For $k = UBound($y)-1 to 0 Step -1 ; Checks to see if counter array indices are above their max and if they are reset them to 0 while increasing the next index up 1 If $y[$k]>UBound($Arrayoarray,1)-1 Then $y[$k] = 0 If $k>0 Then $y[$k-1]=$y[$k-1]+1;Error Handeler for last operation EndIf Next GUICtrlSetData($p1Prog, ($i/$Count)*100);Progressbar updating GUICtrlSetData($l2Label,$i&"/"&$Count);Count label updating Next EndFunc Func Arrayadder() Dim $Arrayoarray[0][0];Clear main array local $hld3 = [];holder 1,2, and 3 local $hld2 local $hld = InputBox("Number of Arrays","Number of Arrays");Asks how many arrays youd like to use For $i = 0 to $hld-1 $hld2 = InputBox("Array "&$i,"Seperate with comas");Asks for the arrays seperated by , $hld3 = StringSplit($hld2,",",$STR_NOCOUNT);Splits string into array If Ubound($hld3) > Ubound($Arrayoarray,1) Then Redim $Arrayoarray[UBound($hld3)][UBound($Arrayoarray,2)];Resets the size of the main array to fit the largest column you enter _ArrayColInsert($Arrayoarray,$i);adds a new column for each array For $g = 0 to Ubound($hld3)-1 $Arrayoarray[$g][$i]=$hld3[$g];sets the values of the main array Next Next EndFunc While 1;Event Handling for GUI $iMsg = GUIGetMsg() Switch $iMsg case $b1Button Startproc() case $GUI_EVENT_CLOSE Exit case $b2Button Arrayadder() EndSwitch WEnd