Share this post

Link to post

Share on other sites

Thatsgreat2345 0

Your setting each to $nn so it will only grab the last input. Thus you must make it an array then read all the data from a for loop using Ubound. By the way your whole construction of long ass data can be easily made into a couple for loops.

Share this post

Link to post

Share on other sites

Bert 1,168

Your setting each to $nn so it will only grab the last input. Thus you must make it an array then read all the data from a for loop using Ubound. By the way your whole construction of long ass data can be easily made into a couple for loops.

Share this post

Link to post

Share on other sites

Bert 1,168

I stripped it out of the script I'm making to keep it short...the one I'm working on is 270 lines, and growing fast. Whats odd in my original script I use the same setup in 2 other places, and they work fine...

The script I'm working on. It will have 4 tabs with the same layout as tab 1. It is for controlling a marquee program I'm making.

#include <GuiConstants.au3>#include <Date.au3>#include <GuiCombo.au3>#include <Misc.au3>_Singleton("Marquee_Console_beta.au3")Global$sini= @ScriptDir&"/bin/settings.ini"global$i,$iaDim$ini,$ini1,$ini2,$ini3,$ini4,$ini5,$ini6Dim$input_name_[8],$input_opt_[8],$input_track_1[64],$Inputname1[8]DIM$InputStat1[8],$InputName1[8],$InputS1_[8]DIm$j,$y,$x,$y1,$j1,$x1Dim$Label_1,$InputS_1,$InputS_2,$InputS_3,$InputS_4,$InputS_5,$InputS_6,$InputS_7,$InputS_8;Dim $button_6ifFileExists($sini)=0then_inimake()$date1=_DateTimeFormat(_NowCalc(),1)$font="Comic Sans MS"$gui1=GuiCreate("Facilities Helpdesk Marquee Console",932,334,-1,-1,BitOR($WS_OVERLAPPEDWINDOW,$WS_CLIPSIBLINGS))GUISetFont(9,400,0,$font)_iniread()#region - tab 0;---------------tab1-------------------------------------------;the color functions are for the color text of the marquee leters. $tab1=GUICtrlCreateTab(0,0,932,334)$tab1a=GUICtrlCreateTabitem("Yesterday")_tab()$button_5=GuiCtrlCreateButton("choose color",20,295,80,20)$button_6=GuiCtrlCreateButton("choose color",190,295,80,20)$_color1=GUICtrlCreateInput("",110,295,20,20,0x0800);shows what color is selected$inicolor1=IniRead($sini,"color","1","")GUICtrlSetBkColor($_color1,$inicolor1)$Label_7=GuiCtrlCreateLabel(" Stats Text color",190,275,120,20)$_color2=GUICtrlCreateInput("",280,295,20,20,0x0800);shows what color is selected$inicolor2=IniRead($sini,"color","2","")GUICtrlSetBkColor($_color2,$inicolor2)$Label_8=GuiCtrlCreateLabel("Operator Text color",20,275,120,20)$Button_9=GuiCtrlCreateButton("Exit",340,275,80,20)$Button_10=GuiCtrlCreateButton("Save Changes",435,275,80,20)$Button_11=GuiCtrlCreateButton("View in Excel",530,275,85,20)$Label_12=GuiCtrlCreateLabel($date1,445,300,200,20)_statname1()_statlist1();---------------tab2-------------------------------------------$tab2=GUICtrlCreateTab(0,0,932,334)$tab2a=GUICtrlCreateTabitem("Today")#cs
Tab 2 will have same layout as tab 1, except for the following
1 - Operator names will be read only. This makes it so only a change on the first tab will update all 4 tabs
2 - Stats list of 8 will be Read only. gets updates from tab 1
3 - yeellow row of inputs will be read only . Gets updates from tab 1
#ce;---------------tab3-------------------------------------------$tab3=GUICtrlCreateTab(0,0,932,334)$tab3a=GUICtrlCreateTabitem("Month to date")#cs
Tab 3 will have same layout as Tab 1, except for the following
1 - Operator names will be read only. This makes it so only a change on the first tab will update all 4 tabs
2 - Stats list of 8 will be Read only. gets updates from tab 1
3 - yellow row of inputs will be read only . Gets updates from tab 1
#ce;---------------tab2-------------------------------------------$tab4=GUICtrlCreateTab(0,0,932,334)$tab4a=GUICtrlCreateTabitem("Year to date")#cs
Tab 4 will have same layout as Tab 1, except for the following
1 - Operator names will be read only. This makes it so only a change on the first tab will update all 4 tabs
2 - Stats list of 8 will be Read only. gets updates from tab 1
3 - yeellow row of inputs will be read only . Gets updates from tab 1
#ceGuiSetState(@SW_SHOW)While1$msg=GuiGetMsg()SelectCase$msg=$GUI_EVENT_CLOSEExitLoopCase$msg=$button_5$color=_ChooseColor(2,0x0000FF,2)GUICtrlSetBkColor($_color1,$color)IniWrite($sini,"color","1",$color)Case$msg=$button_6$color=_ChooseColor(2,0x0000FF,2)GUICtrlSetBkColor($_color2,$color)IniWrite($sini,"color","2",$color)Case$msg=$Button_10_savechange()Case$msg=$Button_9exitCaseElse;;;EndSelectWEndfunc_iniread()$ini1=IniReadSection($sini,"names")$ini2=IniReadSection($sini,"opt")$ini3=IniReadSection($sini,"opt_trak_1")$ini4=IniReadSection($sini,"stat")$ini5=IniReadSection($sini,"opt_trak_2")$ini6=IniReadSection($sini,"stat_names")EndFuncfunc_savechange()local$i=0,$c1[8],$c2[8],$c3[64],$c4[8]local$arr[8]=[$InputS_1,$InputS_2,$InputS_3,$InputS_4,$InputS_5,$InputS_6,$InputS_7,$InputS_8]$Ssa="names"$Ssb="opt"$Ssc="opt_trak_1"$Ssd="stat_names"$key=1$i=0for$i=0to7$c1[$i]=GUICtrlRead($input_name_[$i])next$i=0$key=1for$i=0to7$c2[$i]=GUICtrlRead($input_opt_[$i])next$i=0$key=1for$i=0to63$c3[$i]=GUICtrlRead($input_track_1[$i])nextifIsArray($arr)then$i=0$key=1for$i=0to7step1$c4[$i]=GUICtrlRead($arr[$i])nextendif$sdataa="1="&$c1[0]&@LF&"2="&$c1[1]&@LF&"3="&$c1[2]&@LF&"4="&$c1[3]&@LF&"5="&_$c1[4]&@LF&"6="&$c1[5]&@LF&"7="&$c1[6]&@LF&"8="&$c1[7]&@LF&"9="&$c4[0]&@LF&"10="&_$c4[1]&@LF&"11="&$c4[2]&@LF&"12="&$c4[3]&@LF&"13="&$c4[4]&@LF&"14="&$c4[5]&@LF&_"15="&$c4[6]&@LF&"16="&$c4[7]$sdatab="1="&$c2[0]&@LF&"2="&$c2[1]&@LF&"3="&$c2[2]&@LF&_"4="&$c2[3]&@LF&"5="&$c2[4]&@LF&"6="&$c2[5]&@LF&"7="&$c2[6]&@LF&"8="&$c2[7]$sdatac="1="&$c3[0]&@LF&"2="&$c3[1]&@LF&"3="&$c3[2]&@LF&"4="&$c3[3]&@LF&_"5="&$c3[4]&@LF&"6="&$c3[5]&@LF&"7="&$c3[6]&@LF&"8="&$c3[7]&@LF&"9="&$c3[8]&@LF&_"10="&$c3[9]&@LF&"11="&$c3[10]&@LF&"12="&$c3[11]&@LF&"13="&$c3[12]&@LF&"14="&$c3[13]&@LF&_"15="&$c3[14]&@LF&"16="&$c3[15]&@LF&"17="&$c3[16]&@LF&"18="&$c3[17]&@LF&"19="&$c3[18]&@LF&_"20="&$c3[19]&@LF&"21="&$c3[20]&@LF&"22="&$c3[21]&@LF&"23="&$c3[22]&@LF&"24="&$c3[23]&@LF&_"25="&$c3[24]&@LF&"26="&$c3[25]&@LF&"27="&$c3[26]&@LF&"28="&$c3[27]&@LF&"29="&$c3[28]&@LF&_"30="&$c3[29]&@LF&"31="&$c3[30]&@LF&"32="&$c3[31]&@LF&"33="&$c3[32]&@LF&"34="&$c3[33]&@LF&_"35="&$c3[34]&@LF&"36="&$c3[35]&@LF&"37="&$c3[36]&@LF&"38="&$c3[37]&@LF&"39="&$c3[38]&@LF&_"40="&$c3[39]&@LF&"41="&$c3[40]&@LF&"42="&$c3[41]&@LF&"43="&$c3[42]&@LF&"44="&$c3[43]&@LF&_"45="&$c3[44]&@LF&"46="&$c3[45]&@LF&"47="&$c3[46]&@LF&"48="&$c3[47]&@LF&"49="&$c3[48]&@LF&_"50="&$c3[49]&@LF&"51="&$c3[50]&@LF&"52="&$c3[51]&@LF&"53="&$c3[52]&@LF&"54="&$c3[53]&@LF&_"55="&$c3[54]&@LF&"56="&$c3[55]&@LF&"57="&$c3[56]&@LF&"58="&$c3[57]&@LF&"59="&$c3[58]&@LF&_"60="&$c3[59]&@LF&"61="&$c3[60]&@LF&"62="&$c3[61]&@LF&"63="&$c3[62]&@LF&"64="&$c3[63]IniWriteSection($sini,$Ssa,$sdataa)IniWriteSection($sini,$Ssb,$sdatab)IniWriteSection($sini,$Ssc,$sdatac);#ceEndFuncFunc_tab()$x=180$y1=60$j1=1$x1=180GuiCtrlCreateLabel("Operator",60,40,60,20)GuiCtrlCreateLabel("Stats",750,40,40,20)GuiCtrlCreateGroup("",690,20,230,245)GuiCtrlCreateGroup("",10,20,670,245);----------------------------------------------------------------------------------;names - input_name_1 thru _8$j=1$y=60For$i=0To7$input_name_[$i]=GUICtrlCreateInput($ini1[$j][1],20,($y),140,20);$nn[$i] = GUICtrlCreateInput($ini1[$j][1], 20, ($y), 140, 20)$j=$j+1$y=$y+25Next;-------------;opt names - boxes are yellow - $input_opt_1 thru 8$opstatcol="0xF4F960"$j=1For$i=0To7$input_opt_[$i]=GUICtrlCreateinput($ini2[$j][1],$x,35,50,20)GUICtrlSetBkColor($input_opt_[$i],$opstatcol)$j=$j+1$x=$x+60Next;------------;opt tracking data - 64 boxes are listed by collumn.$r=0$j1=1while$ia<64For$ia=(0+$r)To(7+$r)$input_track_1[$i]=GUICtrlCreateInput($ini3[$j1][1],$x1,$y1,50,20)$j1=$j1+1$x1=$x1+60next$r=$r+8$y1=$y1+25$x1=180wendEndFuncFunc_statname1()$y=60$j=1For$i=0To7$Inputname1[$i]=GUICtrlCreateInput($ini6[$j][1],710,($y),110,20)$j=$j+1$y=$y+25NextEndFuncFunc_statlist1()$j=1$y=60For$i=0To7$InputS1_[$i]=GUICtrlCreateInput($ini4[$j][1],840,($y),50,20)$j=$j+1$y=$y+25NextEndFuncFunc_stat1ist2($InputStat)$j=9$y=60For$i=0To7$InputStat=GUICtrlCreateInput($ini4[$j][1],840,($y),50,20)$j=$j+1$y=$y+25NextEndFuncfunc_inimake()$sData1="1="&@LF&"2="&@LF&"3="&@LF&"4="$sData2="1="&@LF&"2="&@LF&"3="&@LF&"4="&@LF&"5="&@LF&"6="&@LF&"7="&@LF&"8="$sData3="1="&@LF&"2="&@LF&"3="&@LF&"4="&@LF&"5="&@LF&"6="&@LF&"7="&@LF&"8="&@LF&"9="&@LF&"10="&@LF&_"11="&@LF&"12="&@LF&"13="&@LF&"14="&@LF&"15="&@LF&"16="$sData4="1="&@LF&"2="&@LF&"3="&@LF&"4="&@LF&"5="&@LF&"6="&@LF&"7="&@LF&"8="&@LF&"9="&@LF&"10="&@LF&_"11="&@LF&"12="&@LF&"13="&@LF&"14="&@LF&"15="&@LF&"16="&@LF&"17="&@LF&"18="&@LF&"19="&@LF&"20="&@LF&_"21="&@LF&"22="&@LF&"23="&@LF&"24="&@LF&"25="&@LF&"26="&@LF&"27="&@LF&"28="&@LF&"29="&@LF&"30="&@LF&_"31="&@LF&"32="$sData5="1="&@LF&"2="&@LF&"3="&@LF&"4="&@LF&"5="&@LF&"6="&@LF&"7="&@LF&"8="&@LF&"9="&@LF&"10="&@LF&_"11="&@LF&"12="&@LF&"13="&@LF&"14="&@LF&"15="&@LF&"16="&@LF&"17="&@LF&"18="&@LF&"19="&@LF&"20="&@LF&_"21="&@LF&"22="&@LF&"23="&@LF&"24="&@LF&"25="&@LF&"26="&@LF&"27="&@LF&"28="&@LF&"29="&@LF&"30="&@LF&_"31="&@LF&"32="&@LF&"33="&@LF&"34="&@LF&"35="&@LF&"36="&@LF&"37="&@LF&"38="&@LF&"39="&@LF&"40="&@LF&_"41="&@LF&"42="&@LF&"43="&@LF&"44="&@LF&"45="&@LF&"46="&@LF&"47="&@LF&"48="&@LF&"49="&@LF&"50="&@LF&_"51="&@LF&"52="&@LF&"53="&@LF&"54="&@LF&"55="&@LF&"56="&@LF&"57="&@LF&"58="&@LF&"59="&@LF&"60="&@LF&_"61="&@LF&"62="&@LF&"63="&@LF&"64="IniWriteSection($sini,"color",$sData1)IniWriteSection($sini,"names",$sData3)IniWriteSection($sini,"opt",$sData2)IniWriteSection($sini,"opt_trak_1",$sData5)IniWriteSection($sini,"opt_trak_2",$sData5)IniWriteSection($sini,"stat",$sData4)IniWriteSection($sini,"stat_names",$sData2)EndFunc