local ldtbl2 = {} local prvtbl2 = {} local prvindex2 = 0 ldtbl2.openFileFullTex = "" ldtbl2.openFileFullPath = "" ldtbl2.slcOpt = 0 local mnCpt44 = 'TableLoadOpt ('..ldtbl2.slcOpt..')' if miLdTblClk then miLdTblClk.Destroy() miLdTblClk=nil end miLdTblClk = "" ldtbl2.lclFunc = (function(s) return s() end) --############################################################################-- --############################################################################-- --############################################################################-- ldtbl2.cbcheck1=0 ldtbl2.cbcheck2=0 ldtbl2.cbcheck3=0 ldtbl2.cbcheck4=0 ldtbl2.cbcheck5=0 ldtbl2.cbcheck6=0 ldtbl2.cbcheck7=0 ldtbl2.cbcheck8=0 ldtbl2.cbcheck11=0 ldtbl2.cbcheck12=0 ldtbl2.cbcheck18=0 set44 = getSettings("ldopt1") function saveOpt44() set44.Value['opt44'] = ldtbl2.slcOpt for i=0, 7 do set44.Value['chcheck'..i + 1] = tonumber(ldtbl2["cbcheck"..i + 1]) end set44.Value['chcheck11'] = ldtbl2.cbcheck11 set44.Value['chcheck12'] = ldtbl2.cbcheck12 set44.Value['chcheck18'] = ldtbl2.cbcheck18 end function loadOpt44() local save44 = 0 if set44.Value['opt44']==nil or set44.Value['opt44']=="" then saveOpt44() end save44 = set44.Value['opt44'] if set44.Value['chcheck1']~=nil then for i=0, 7 do ldtbl2["cbcheck"..i + 1] = tonumber(set44.Value['chcheck'..i + 1]) end ldtbl2.cbcheck11 = set44.Value['chcheck11'] ldtbl2.cbcheck12 = set44.Value['chcheck12'] ldtbl2.cbcheck18 = set44.Value['chcheck18'] end if save44~="" or tonumber(save44)~=0 then ldtbl2.slcOpt = save44 if ldtbl2.slcOpt~=nil or ldtbl2.slcOpt~=" " then mnCpt44 = 'TableLoadOpt('..tostring(ldtbl2.slcOpt)..')' MainForm.actOpen.OnExecute=function() if MainForm.OpenDialog1.execute() then ldtbl2.openFileFullPath = MainForm.OpenDialog1.FileName ldtbl2.lclFunc() end end end end end loadOpt44() --############################################################################-- --############################################################################-- function ldTableOptions() if fullSlctFrm then fullSlctFrm.Destroy() fullSlctFrm=nil end DP1=getScreenDPI()/96 fullSlctFrm=createForm(MainForm) fullSlctFrm.height=260*DP1 fullSlctFrm.width=280*DP1 fullSlctFrm.left=261*DP1 fullSlctFrm.top=100*DP1 fullSlctFrm.PopupMode=0 fullSlctFrm.caption="By AylinCE Trainers (2024)" fullSlctFrm.Position="poDesktopCenter" fullSlctFrm.BorderStyle="bsNone" fullSlctFrm.ShowInTaskBar="stAlways" fullSlctFrm.Font.Color=0xffffff fullSlctFrm.setLayeredAttributes(0x000100, 255, LWA_COLORKEY | LWA_ALPHA ) fullSlctFrm.Color = 0x000100 ------------------------- ----------------------- ldtbl2.fsf_pnl1 -----  ldtbl2.fsf_pnl1=createPanel(fullSlctFrm) ldtbl2.fsf_pnl1.AutoSize=false ldtbl2.fsf_pnl1.height=30*DP1 ldtbl2.fsf_pnl1.width=260*DP1 ldtbl2.fsf_pnl1.left=10*DP1 ldtbl2.fsf_pnl1.top=5*DP1 ldtbl2.fsf_pnl1.caption="Create Your Selection to Load Table!" ldtbl2.fsf_pnl1.Color=15042590 ldtbl2.fsf_pnl1.Font.Style="fsBold" ldtbl2.fsf_pnl1.Cursor= -22 ldtbl2.fsf_pnl1.OnMouseDown = function() fullSlctFrm.DragNow() end ----------------------- ----------------------- ldtbl2.fsf_pnl2 -----  ldtbl2.fsf_pnl2=createPanel(fullSlctFrm) ldtbl2.fsf_pnl2.AutoSize=false ldtbl2.fsf_pnl2.height=175*DP1 ldtbl2.fsf_pnl2.width=260*DP1 ldtbl2.fsf_pnl2.left=10*DP1 ldtbl2.fsf_pnl2.top=40*DP1 ldtbl2.fsf_pnl2.Color=15042590 ldtbl2.fsf_pnl2.Font.Style="fsBold" ldtbl2.fsf_pnl2.Font.Size=10*DP1 ----------------------- ----------------------- ldtbl2.fsf_pnl4 -----  ldtbl2.fsf_pnl4=createPanel(ldtbl2.fsf_pnl2) ldtbl2.fsf_pnl4.AutoSize=false ldtbl2.fsf_pnl4.height=30*DP1 ldtbl2.fsf_pnl4.width=254*DP1 ldtbl2.fsf_pnl4.left=3*DP1 ldtbl2.fsf_pnl4.top=10*DP1 ldtbl2.fsf_pnl4.Color = 16098626 ldtbl2.fsf_pnl4.Font.Style="fsBold" ldtbl2.fsf_pnl4.Font.Size=12*DP1 ----------------------- ----------------------- ldtbl2.fsf_chkbx11 -----  ldtbl2.fsf_chkbx11=createCheckBox(ldtbl2.fsf_pnl4) ldtbl2.fsf_chkbx11.AutoSize=true ldtbl2.fsf_chkbx11.height=23*DP1 ldtbl2.fsf_chkbx11.width=149*DP1 ldtbl2.fsf_chkbx11.left=7*DP1 ldtbl2.fsf_chkbx11.top=4*DP1 ldtbl2.fsf_chkbx11.caption=" My Table" ldtbl2.fsf_chkbx11.alignment="taRightJustify" ldtbl2.fsf_chkbx11.Font.Style="fsBold" ldtbl2.fsf_chkbx11.Font.Size=10*DP1 ----------------------- ----------------------- ldtbl2.fsf_chkbx12 -----  ldtbl2.fsf_chkbx12=createCheckBox(ldtbl2.fsf_pnl4) ldtbl2.fsf_chkbx12.AutoSize=false ldtbl2.fsf_chkbx12.height=23*DP1 ldtbl2.fsf_chkbx12.width=95*DP1 ldtbl2.fsf_chkbx12.left=152*DP1 ldtbl2.fsf_chkbx12.top=4*DP1 ldtbl2.fsf_chkbx12.caption="Load Table " ldtbl2.fsf_chkbx12.alignment="taLeftJustify" ldtbl2.fsf_chkbx12.Font.Style="fsBold" ldtbl2.fsf_chkbx12.Font.Size=10*DP1 ----------------------- ----------------------- ldtbl2.fsf_chkbx1 -----  ldtbl2.fsf_chkbx1=createCheckBox(ldtbl2.fsf_pnl2) ldtbl2.fsf_chkbx1.AutoSize=false ldtbl2.fsf_chkbx1.height=23*DP1 ldtbl2.fsf_chkbx1.width=23*DP1 ldtbl2.fsf_chkbx1.left=10*DP1 ldtbl2.fsf_chkbx1.top=50*DP1 ldtbl2.fsf_chkbx1.caption="" ldtbl2.fsf_chkbx1.alignment="taRightJustify" ldtbl2.fsf_chkbx1.Font.Style="fsBold" ldtbl2.fsf_chkbx1.Font.Size=10*DP1 ----------------------- ----------------------- ldtbl2.fsf_lbl1 -----  ldtbl2.fsf_lbl1=createLabel(ldtbl2.fsf_pnl2) ldtbl2.fsf_lbl1.AutoSize=false ldtbl2.fsf_lbl1.height=19*DP1 ldtbl2.fsf_lbl1.width=190*DP1 ldtbl2.fsf_lbl1.left=35*DP1 ldtbl2.fsf_lbl1.top=52*DP1 ldtbl2.fsf_lbl1.caption=" <--------- Files ---------> " ldtbl2.fsf_lbl1.alignment="taCenter" ldtbl2.fsf_lbl1.Font.Style="fsBold" ldtbl2.fsf_lbl1.Font.Size=11*DP1 ----------------------- ----------------------- ldtbl2.fsf_chkbx2 -----  ldtbl2.fsf_chkbx2=createCheckBox(ldtbl2.fsf_pnl2) ldtbl2.fsf_chkbx2.AutoSize=true ldtbl2.fsf_chkbx2.height=23*DP1 ldtbl2.fsf_chkbx2.width=23*DP1 ldtbl2.fsf_chkbx2.left=237*DP1 ldtbl2.fsf_chkbx2.top=50*DP1 ldtbl2.fsf_chkbx2.caption="" ldtbl2.fsf_chkbx2.alignment="taRightJustify" ldtbl2.fsf_chkbx2.Font.Style="fsBold" ldtbl2.fsf_chkbx2.Font.Size=10*DP1 ----------------------- ----------------------- ldtbl2.fsf_chkbx3 -----  ldtbl2.fsf_chkbx3=createCheckBox(ldtbl2.fsf_pnl2) ldtbl2.fsf_chkbx3.AutoSize=true ldtbl2.fsf_chkbx3.height=23*DP1 ldtbl2.fsf_chkbx3.width=23*DP1 ldtbl2.fsf_chkbx3.left=10*DP1 ldtbl2.fsf_chkbx3.top=80*DP1 ldtbl2.fsf_chkbx3.caption="" ldtbl2.fsf_chkbx3.alignment="taRightJustify" ldtbl2.fsf_chkbx3.Font.Style="fsBold" ldtbl2.fsf_chkbx3.Font.Size=10*DP1 ----------------------- ----------------------- ldtbl2.fsf_lbl2 -----  ldtbl2.fsf_lbl2=createLabel(ldtbl2.fsf_pnl2) ldtbl2.fsf_lbl2.AutoSize=false ldtbl2.fsf_lbl2.height=19*DP1 ldtbl2.fsf_lbl2.width=190*DP1 ldtbl2.fsf_lbl2.left=35*DP1 ldtbl2.fsf_lbl2.top=82*DP1 ldtbl2.fsf_lbl2.caption=" <-------- Forms --------> " ldtbl2.fsf_lbl2.alignment="taCenter" ldtbl2.fsf_lbl2.Font.Style="fsBold" ldtbl2.fsf_lbl2.Font.Size=11*DP1 ----------------------- ----------------------- ldtbl2.fsf_chkbx4 -----  ldtbl2.fsf_chkbx4=createCheckBox(ldtbl2.fsf_pnl2) ldtbl2.fsf_chkbx4.AutoSize=true ldtbl2.fsf_chkbx4.height=23*DP1 ldtbl2.fsf_chkbx4.width=23*DP1 ldtbl2.fsf_chkbx4.left=237*DP1 ldtbl2.fsf_chkbx4.top=80*DP1 ldtbl2.fsf_chkbx4.caption="" ldtbl2.fsf_chkbx4.alignment="taRightJustify" ldtbl2.fsf_chkbx4.Font.Style="fsBold" ldtbl2.fsf_chkbx4.Font.Size=10*DP1 ----------------------- ----------------------- ldtbl2.fsf_chkbx5 -----  ldtbl2.fsf_chkbx5=createCheckBox(ldtbl2.fsf_pnl2) ldtbl2.fsf_chkbx5.AutoSize=true ldtbl2.fsf_chkbx5.height=23*DP1 ldtbl2.fsf_chkbx5.width=23*DP1 ldtbl2.fsf_chkbx5.left=10*DP1 ldtbl2.fsf_chkbx5.top=110*DP1 ldtbl2.fsf_chkbx5.caption="" ldtbl2.fsf_chkbx5.alignment="taRightJustify" ldtbl2.fsf_chkbx5.Font.Style="fsBold" ldtbl2.fsf_chkbx5.Font.Size=10*DP1 ----------------------- ----------------------- ldtbl2.fsf_lbl13 -----  ldtbl2.fsf_lbl3=createLabel(ldtbl2.fsf_pnl2) ldtbl2.fsf_lbl3.AutoSize=false ldtbl2.fsf_lbl3.height=19*DP1 ldtbl2.fsf_lbl3.width=190*DP1 ldtbl2.fsf_lbl3.left=35*DP1 ldtbl2.fsf_lbl3.top=112*DP1 ldtbl2.fsf_lbl3.caption=" <---- Address List ----> " ldtbl2.fsf_lbl3.alignment="taCenter" ldtbl2.fsf_lbl3.Font.Style="fsBold" ldtbl2.fsf_lbl3.Font.Size=11*DP1 ----------------------- ----------------------- ldtbl2.fsf_chkbx6 -----  ldtbl2.fsf_chkbx6=createCheckBox(ldtbl2.fsf_pnl2) ldtbl2.fsf_chkbx6.AutoSize=true ldtbl2.fsf_chkbx6.height=23*DP1 ldtbl2.fsf_chkbx6.width=202*DP1 ldtbl2.fsf_chkbx6.left=237*DP1 ldtbl2.fsf_chkbx6.top=110*DP1 ldtbl2.fsf_chkbx6.caption="" ldtbl2.fsf_chkbx6.alignment="taRightJustify" ldtbl2.fsf_chkbx6.Font.Style="fsBold" ldtbl2.fsf_chkbx6.Font.Size=10*DP1 ----------------------- ----------------------- ldtbl2.fsf_chkbx7 -----  ldtbl2.fsf_chkbx7=createCheckBox(ldtbl2.fsf_pnl2) ldtbl2.fsf_chkbx7.AutoSize=true ldtbl2.fsf_chkbx7.height=23*DP1 ldtbl2.fsf_chkbx7.width=23*DP1 ldtbl2.fsf_chkbx7.left=10*DP1 ldtbl2.fsf_chkbx7.top=140*DP1 ldtbl2.fsf_chkbx7.caption="" ldtbl2.fsf_chkbx7.alignment="taRightJustify" ldtbl2.fsf_chkbx7.Font.Style="fsBold" ldtbl2.fsf_chkbx7.Font.Size=10*DP1 ----------------------- ----------------------- ldtbl2.fsf_lbl4 -----  ldtbl2.fsf_lbl4=createLabel(ldtbl2.fsf_pnl2) ldtbl2.fsf_lbl4.AutoSize=false ldtbl2.fsf_lbl4.height=19*DP1 ldtbl2.fsf_lbl4.width=190*DP1 ldtbl2.fsf_lbl4.left=35*DP1 ldtbl2.fsf_lbl4.top=142*DP1 ldtbl2.fsf_lbl4.caption=" <----- Lua Script -----> " ldtbl2.fsf_lbl4.alignment="taCenter" ldtbl2.fsf_lbl4.Font.Style="fsBold" ldtbl2.fsf_lbl4.Font.Size=11*DP1 ----------------------- ----------------------- ldtbl2.fsf_chkbx8 -----  ldtbl2.fsf_chkbx8=createCheckBox(ldtbl2.fsf_pnl2) ldtbl2.fsf_chkbx8.AutoSize=true ldtbl2.fsf_chkbx8.height=23*DP1 ldtbl2.fsf_chkbx8.width=23*DP1 ldtbl2.fsf_chkbx8.left=237*DP1 ldtbl2.fsf_chkbx8.top=140*DP1 ldtbl2.fsf_chkbx8.caption="" ldtbl2.fsf_chkbx8.alignment="taRightJustify" ldtbl2.fsf_chkbx8.Font.Style="fsBold" ldtbl2.fsf_chkbx8.Font.Size=10*DP1 ----------------------- ----------------------- ldtbl2.fsf_pnl3 -----  ldtbl2.fsf_pnl3=createPanel(fullSlctFrm) ldtbl2.fsf_pnl3.AutoSize=false ldtbl2.fsf_pnl3.height=34*DP1 ldtbl2.fsf_pnl3.width=260*DP1 ldtbl2.fsf_pnl3.left=10*DP1 ldtbl2.fsf_pnl3.top=220*DP1 ldtbl2.fsf_pnl3.Color=16098626 ldtbl2.fsf_pnl3.Font.Style="fsBold" ldtbl2.fsf_pnl3.Font.Size=12*DP1 ----------------------- ----------------------- ldtbl2.fsf_chkbx8 -----  ldtbl2.fsf_chkbx18=createCheckBox(ldtbl2.fsf_pnl3) ldtbl2.fsf_chkbx18.AutoSize=true ldtbl2.fsf_chkbx18.height=23*DP1 ldtbl2.fsf_chkbx18.width=23*DP1 ldtbl2.fsf_chkbx18.left=10*DP1 ldtbl2.fsf_chkbx18.top=5*DP1 ldtbl2.fsf_chkbx18.caption="Default" ldtbl2.fsf_chkbx18.alignment="taRightJustify" ldtbl2.fsf_chkbx18.Font.Style="fsBold" ldtbl2.fsf_chkbx18.Font.Size=10*DP1 ----------------------- ----------------------- ldtbl2.fsf_btn4 -----  ldtbl2.fsf_btn4=createButton(ldtbl2.fsf_pnl3) ldtbl2.fsf_btn4.AutoSize=false ldtbl2.fsf_btn4.height=25*DP1 ldtbl2.fsf_btn4.width=90*DP1 ldtbl2.fsf_btn4.left=80*DP1 ldtbl2.fsf_btn4.top=4*DP1 ldtbl2.fsf_btn4.Font.Style="fsBold" ldtbl2.fsf_btn4.Font.Size=10*DP1 ------------------------ ----------------------- ldtbl2.fsf_btn3 -----  ldtbl2.fsf_btn3=createButton(ldtbl2.fsf_pnl3) ldtbl2.fsf_btn3.AutoSize=false ldtbl2.fsf_btn3.height=25*DP1 ldtbl2.fsf_btn3.width=50*DP1 ldtbl2.fsf_btn3.left=175*DP1 ldtbl2.fsf_btn3.top=4*DP1 ldtbl2.fsf_btn3.caption="Save" ldtbl2.fsf_btn3.Font.Style="fsBold" ldtbl2.fsf_btn3.Font.Size=10*DP1 ------------------------ ----------------------- ldtbl2.fsf_btn2 -----  ldtbl2.fsf_btn2=createButton(ldtbl2.fsf_pnl3) ldtbl2.fsf_btn2.AutoSize=false ldtbl2.fsf_btn2.height=25*DP1 ldtbl2.fsf_btn2.width=24*DP1 ldtbl2.fsf_btn2.left=230*DP1 ldtbl2.fsf_btn2.top=4*DP1 ldtbl2.fsf_btn2.caption="X" ldtbl2.fsf_btn2.Font.Style="fsBold" ldtbl2.fsf_btn2.Font.Size=11*DP1 ----------------------- for i=0, 7 do ldtbl2["fsf_chkbx"..i + 1].Cursor = -21 end ldtbl2.fsf_chkbx11.Cursor = -21 ldtbl2.fsf_chkbx12.Cursor = -21 ldtbl2.fsf_chkbx18.Cursor = -21 ----------------------- --############################################################################-- ldtbl2.fsf_chkbx1.State=ldtbl2.cbcheck1 ldtbl2.fsf_chkbx2.State=ldtbl2.cbcheck2 ldtbl2.fsf_chkbx3.State=ldtbl2.cbcheck3 ldtbl2.fsf_chkbx4.State=ldtbl2.cbcheck4 ldtbl2.fsf_chkbx5.State=ldtbl2.cbcheck5 ldtbl2.fsf_chkbx6.State=ldtbl2.cbcheck6 ldtbl2.fsf_chkbx7.State=ldtbl2.cbcheck7 ldtbl2.fsf_chkbx8.State=ldtbl2.cbcheck8 ldtbl2.fsf_chkbx18.State=ldtbl2.cbcheck18 local ldtbl3 = {ldtbl2.cbcheck1,ldtbl2.cbcheck3,ldtbl2.cbcheck5,ldtbl2.cbcheck7} local ldtbl4 = {ldtbl2.cbcheck2,ldtbl2.cbcheck4,ldtbl2.cbcheck6,ldtbl2.cbcheck8} --############################################################################-- if ldtbl2.cbcheck1==1 and ldtbl2.cbcheck3==1 and ldtbl2.cbcheck5==1 and ldtbl2.cbcheck7==1 then ldtbl2.fsf_chkbx11.State = 1 else ldtbl2.fsf_chkbx11.State = 0 end if ldtbl2.cbcheck2==1 and ldtbl2.cbcheck4==1 and ldtbl2.cbcheck6==1 and ldtbl2.cbcheck8==1 then ldtbl2.fsf_chkbx12.State = 1 else ldtbl2.fsf_chkbx12.State = 0 end function chckState(tbl,index) flags = 0 for i,k in pairs(tbl) do if tonumber(index)~=tonumber(k) then flags = tonumber(flags) + 1 end end --print("flags: "..flags) return flags end ldtbl2.fsf_chkbx1.OnChange=function(sender) ldtbl3[1] = tonumber(sender.State) print(ldtbl3[ldtbl2.cbcheck1]) if sender.State==1 then ldtbl2.fsf_chkbx18.State=0 end aa1 = chckState(ldtbl3,ldtbl3[1]) if tonumber(aa1)==0 then ldtbl2.cbcheck11=sender.State else ldtbl2.cbcheck11=0 end ldtbl2.fsf_chkbx11.State = ldtbl2.cbcheck11 end ldtbl2.fsf_chkbx3.OnChange=function(sender) ldtbl3[2] = tonumber(sender.State) print(ldtbl3[ldtbl2.cbcheck3]) if sender.State==1 then ldtbl2.fsf_chkbx18.State=0 end aa1 = chckState(ldtbl3,sender.State) if aa1==0 then ldtbl2.cbcheck11=sender.State else ldtbl2.cbcheck11=0 end ldtbl2.fsf_chkbx11.State = ldtbl2.cbcheck11 end ldtbl2.fsf_chkbx5.OnChange=function(sender) ldtbl3[3] = tonumber(sender.State) print(ldtbl3[ldtbl2.cbcheck5]) if sender.State==1 then ldtbl2.fsf_chkbx18.State=0 end aa1 = chckState(ldtbl3,sender.State) if aa1==0 then ldtbl2.cbcheck11=sender.State else ldtbl2.cbcheck11=0 end ldtbl2.fsf_chkbx11.State = ldtbl2.cbcheck11 end ldtbl2.fsf_chkbx7.OnChange=function(sender) ldtbl3[4] = tonumber(sender.State) print(ldtbl3[ldtbl2.cbcheck7]) if sender.State==1 then ldtbl2.fsf_chkbx18.State=0 end aa1 = chckState(ldtbl3,sender.State) if aa1==0 then ldtbl2.cbcheck11=sender.State else ldtbl2.cbcheck11=0 end ldtbl2.fsf_chkbx11.State = ldtbl2.cbcheck11 end ldtbl2.fsf_chkbx2.OnChange=function(sender) ldtbl4[1] = tonumber(sender.State) if sender.State==1 then ldtbl2.fsf_chkbx18.State=0 end aa1 = chckState(ldtbl4,sender.State) if aa1==0 then ldtbl2.cbcheck12=sender.State else ldtbl2.cbcheck12=0 end ldtbl2.fsf_chkbx12.State = ldtbl2.cbcheck12 end ldtbl2.fsf_chkbx4.OnChange=function(sender) ldtbl4[2] = tonumber(sender.State) if sender.State==1 then ldtbl2.fsf_chkbx18.State=0 end aa1 = chckState(ldtbl4,sender.State) if aa1==0 then ldtbl2.cbcheck12=sender.State else ldtbl2.cbcheck12=0 end ldtbl2.fsf_chkbx12.State = ldtbl2.cbcheck12 end ldtbl2.fsf_chkbx6.OnChange=function(sender) ldtbl4[3] = tonumber(sender.State) if sender.State==1 then ldtbl2.fsf_chkbx18.State=0 end aa1 = chckState(ldtbl4,sender.State) if aa1==0 then ldtbl2.cbcheck12=sender.State else ldtbl2.cbcheck12=0 end ldtbl2.fsf_chkbx12.State = ldtbl2.cbcheck12 end ldtbl2.fsf_chkbx8.OnChange=function(sender) ldtbl4[4] = tonumber(sender.State) if sender.State==1 then ldtbl2.fsf_chkbx18.State=0 end aa1 = chckState(ldtbl4,sender.State) if aa1==0 then ldtbl2.cbcheck12=sender.State else ldtbl2.cbcheck12=0 end ldtbl2.fsf_chkbx12.State = ldtbl2.cbcheck12 end ldtbl2.fsf_chkbx11.OnChange=function(sender) if sender.State==1 then ldtbl2.fsf_chkbx1.State=1 ldtbl2.fsf_chkbx3.State=1 ldtbl2.fsf_chkbx5.State=1 ldtbl2.fsf_chkbx7.State=1 else ldtbl2.fsf_chkbx1.State=0 ldtbl2.fsf_chkbx3.State=0 ldtbl2.fsf_chkbx5.State=0 ldtbl2.fsf_chkbx7.State=0 end end ldtbl2.fsf_chkbx12.OnChange=function(sender) if sender.State==1 then ldtbl2.fsf_chkbx2.State=1 ldtbl2.fsf_chkbx4.State=1 ldtbl2.fsf_chkbx6.State=1 ldtbl2.fsf_chkbx8.State=1 else ldtbl2.fsf_chkbx2.State=0 ldtbl2.fsf_chkbx4.State=0 ldtbl2.fsf_chkbx6.State=0 ldtbl2.fsf_chkbx8.State=0 end end ldtbl2.fsf_chkbx18.OnChange=function(sender) if sender.State==1 then ldtbl2.fsf_chkbx11.State=0 ldtbl2.fsf_chkbx12.State=0 end end ldtbl2.fsf_btn3.OnClick=function() if ldtbl2.fsf_chkbx1.State==0 and ldtbl2.fsf_chkbx2.State==0 and ldtbl2.fsf_chkbx3.State==0 and ldtbl2.fsf_chkbx4.State==0 and ldtbl2.fsf_chkbx5.State==0 and ldtbl2.fsf_chkbx6.State==0 and ldtbl2.fsf_chkbx7.State==0 and ldtbl2.fsf_chkbx8.State==0 and ldtbl2.fsf_chkbx18.State==0 then ldtbl2.fsf_chkbx18.State=1 showMessage("No election has been made!\nDefault CE installation active!\nIf previous selections were cancelled,\nrestart the CE to use the '0' selection format!") ldtbl2.slcOpt = 0 else if ldtbl2.fsf_chkbx1.State==1 or ldtbl2.fsf_chkbx2.State==1 or ldtbl2.fsf_chkbx3.State==1 or ldtbl2.fsf_chkbx4.State==1 or ldtbl2.fsf_chkbx5.State==1 or ldtbl2.fsf_chkbx6.State==1 or ldtbl2.fsf_chkbx7.State==1 or ldtbl2.fsf_chkbx8.State==1 then ldtbl2.slcOpt = 1 end end if ldtbl2.slcOpt~=0 then MainForm.actOpen.OnExecute=function() if MainForm.OpenDialog1.execute() then ldtbl2.openFileFullPath = MainForm.OpenDialog1.FileName ldtbl2.lclFunc() end end end ldtbl2.cbcheck1=ldtbl2.fsf_chkbx1.State ldtbl2.cbcheck2=ldtbl2.fsf_chkbx2.State ldtbl2.cbcheck3=ldtbl2.fsf_chkbx3.State ldtbl2.cbcheck4=ldtbl2.fsf_chkbx4.State ldtbl2.cbcheck5=ldtbl2.fsf_chkbx5.State ldtbl2.cbcheck6=ldtbl2.fsf_chkbx6.State ldtbl2.cbcheck7=ldtbl2.fsf_chkbx7.State ldtbl2.cbcheck8=ldtbl2.fsf_chkbx8.State ldtbl2.cbcheck11=ldtbl2.fsf_chkbx11.State ldtbl2.cbcheck12=ldtbl2.fsf_chkbx12.State ldtbl2.cbcheck18=ldtbl2.fsf_chkbx18.State mnCpt44 = 'TableLoadOpt('..ldtbl2.slcOpt..')' miLdTblClk.Caption = mnCpt44 saveOpt44() end prvindex2 = #prvtbl2 ldtbl2.fsf_btn4.caption="PrevTable("..prvindex2..")" local tPath5 = getTempFolder().."testLoadTbl5.CT" ldtbl2.fsf_btn4.OnClick=function() if tonumber(prvindex2)==0 then showMessage("That's it for the list of saved tables!\nClick on the 'TableLoadOpt' menu to reload the list!") else aaTbl2 = prvtbl2[prvindex2] prvindex2 = tonumber(prvindex2) - 1 ldtbl2.fsf_btn4.caption="PrevTable("..prvindex2..")" if aaTbl2 then sl3 = createStringList() sl3.Text = aaTbl2 sl3.saveToFile(tPath5) if tPath5 then loadTable(tPath5) end sl3.Destroy() deleteFile(tPath5) end end end ldtbl2.fsf_btn2.OnClick=function() fullSlctFrm.Hide() end end --############################################################################-- --############################################################################-- --############################################################################-- ldtbl2.sladdr = {} ldtbl2.slscrpt = {} ldtbl2.myaddr = {} ldtbl2.myscrpt = {} ldtbl2.myforms = {} ldtbl2.slforms = {} ldtbl2.myfiles = {} ldtbl2.slfiles = {} ldtbl2.collecting=false ------------------------------------------ ldtbl2.aa44 = [[ ]] ------------------------------------------ --###########################################################################-- --###########################################################################-- function startSaveFormLst(text,tbl4) sl2 = createStringList() sl2.Text = text ldtbl2.collecting=false for i=2, sl2.Count -1 do tx1 = sl2[i] tx2 = sl2[tonumber(i) - 1] if (tx2):find("") then if not (tx2):find([[%"%"]]) then ldtbl2.collecting=true end end if (tx1):find("") then if not (tx1):find([[%"%"]]) then ldtbl2.collecting=false end end if ldtbl2.collecting==true then table.insert(tbl4, tx1) end end sl2.Destroy() end function startSaveFileLst(text,tbl4) sl2 = createStringList() sl2.Text = text ldtbl2.collecting=false for i=2, sl2.Count -1 do tx1 = sl2[i] tx2 = sl2[tonumber(i) - 1] if (tx2):find("") then if not (tx2):find([[%"%"]]) then ldtbl2.collecting=true end end if (tx1):find("") then if not (tx1):find([[%"%"]]) then ldtbl2.collecting=false end end if ldtbl2.collecting==true then table.insert(tbl4, tx1) end end sl2.Destroy() end function startSaveScrptLst(text,tbl3) sl2 = createStringList() sl2.Text = text ldtbl2.collecting=false for i=2, sl2.Count -1 do tx1 = sl2[i] tx2 = sl2[tonumber(i) - 1] if (tx2):find("") then if not (tx2):find([[%"%"]]) then ldtbl2.collecting=true end end if (tx1):find("") then if not (tx1):find([[%"%"]]) then ldtbl2.collecting=false end end if ldtbl2.collecting==true then table.insert(tbl3, tx1) end end sl2.Destroy() end --###########################################################################-- function startSaveAddrLst(text,tbl1) sl2 = createStringList() sl2.Text = text ldtbl2.collecting=false for i=2, sl2.Count -1 do tx1 = sl2[i] tx2 = sl2[tonumber(i) - 1] if (tx2):find("") then if not (tx2):find([[""]]) or (tx2):find([['']]) then ldtbl2.collecting=true end end if (tx1):find("") then if not (tx1):find([[%"%"]]) then ldtbl2.collecting=false end end if ldtbl2.collecting==true then table.insert(tbl1, tx1) end end sl2.Destroy() end local tPath3 = getTempFolder().."testLoadTbl3.lua" function selectTableFullCode() ldtbl2.openFileFullText = "" --local orgPath,orgName,orgExt = string.match(ldtbl2.openFileFullPath, "^(.-)([^\\/]-)(%.[^\\/%.]-)%.?$") tableFileName = ldtbl2.openFileFullPath:match('^[(%w:\\)].*\\(.-%..-)$') or ldtbl2.openFileFullPath createTableFile(tableFileName, ldtbl2.openFileFullPath) if tableFileName then findTableFile(tableFileName).saveToFile(tPath3) tableFile = findTableFile(tableFileName) tableFile.delete() end if tPath3~=nil then files1 = io.open(tPath3, "r") ldtbl2.openFileFullText = files1:read('*a') files1:close() if ldtbl2.openFileFullText then deleteFile(tPath3) end end return ldtbl2.openFileFullText end function myTableFullCode() ss1 = createStringStream() saveTable(ss1) aa23 = ss1.DataString prvtbl2[#prvtbl2 + 1] = aa23 --print(aa23) --loadTable(aa23,true) ss1.Destroy() return aa23 end function clearFullTable(tbl) if type(tbl)=="table" then for i,k in pairs(tbl) do tbl[i] = nil end end return tbl end ------------------------------------------------- ------------------------------------------------- function addFullCode() for i=0, 7 do ldtbl2["cbcheck"..i + 1] = tonumber(ldtbl2["cbcheck"..i + 1]) end ldtbl2.openFileFullText = "" clearFullTable(ldtbl2.myforms) clearFullTable(ldtbl2.slforms) clearFullTable(ldtbl2.myfiles) clearFullTable(ldtbl2.slfiles) clearFullTable(ldtbl2.sladdr) clearFullTable(ldtbl2.myaddr) clearFullTable(ldtbl2.slscrpt) clearFullTable(ldtbl2.myscrpt) mycode = myTableFullCode() fullText = "" if fullText=="" then slcode = selectTableFullCode() end if ldtbl2.cbcheck1==0 and ldtbl2.cbcheck2==0 and ldtbl2.cbcheck3==0 and ldtbl2.cbcheck4==0 then fullText = fullText..ldtbl2.aa44.."\n \n" else fullText = fullText..ldtbl2.aa44.."\n" end --------------------- forms ----------------------- if mycode then if ldtbl2.cbcheck1==1 then if (mycode):find("") then fullText = fullText.."\n" startSaveFormLst(mycode,ldtbl2.myforms) for i,k in pairs(ldtbl2.myforms) do fullText = fullText..k.."\n" end end end end if ldtbl2.cbcheck2==1 then if (slcode):find("") then if ldtbl2.cbcheck1==0 then fullText = fullText.."\n" else if not (mycode):find("") then fullText = fullText.."\n" end end startSaveFormLst(slcode,ldtbl2.slforms) for i,k in pairs(ldtbl2.slforms) do fullText = fullText..k.."\n" end end end if ldtbl2.cbcheck1~=0 or ldtbl2.cbcheck2~=0 then fullText = fullText.." \n" end ------------------------ files ------------------------- if mycode then if ldtbl2.cbcheck3==1 then if (mycode):find("") then fullText = fullText.."\n" startSaveFormLst(mycode,ldtbl2.myfiles) for i,k in pairs(ldtbl2.myfiles) do fullText = fullText..k.."\n" end end end end if ldtbl2.cbcheck4==1 then if (slcode):find("") then if ldtbl2.cbcheck3==0 then fullText = fullText.."\n" else if not (mycode):find("") then fullText = fullText.."\n" end end startSaveFileLst(slcode,ldtbl2.slfiles) for i,k in pairs(ldtbl2.slfiles) do fullText = fullText..k.."\n" end end end if ldtbl2.cbcheck3~=0 or ldtbl2.cbcheck4~=0 then fullText = fullText.." \n" end -------------------- addres list --------------------------- if ldtbl2.cbcheck5==1 then if (mycode):find("") then fullText = fullText.." \n" startSaveAddrLst(mycode,ldtbl2.myaddr) for i,k in pairs(ldtbl2.myaddr) do fullText = fullText..k.."\n" end end end if ldtbl2.cbcheck6==1 then if (slcode):find("") then if ldtbl2.cbcheck5==0 then fullText = fullText.." \n" else if not (mycode):find("") then fullText = fullText.." \n" end end startSaveAddrLst(slcode,ldtbl2.sladdr) for i,k in pairs(ldtbl2.sladdr) do fullText = fullText..k.."\n" end end end if ldtbl2.cbcheck5~=0 or ldtbl2.cbcheck6~=0 then fullText = fullText.." \n" end ----------------------- lua scripts ----------------------- if ldtbl2.cbcheck7==1 then if (mycode):find("") then fullText = fullText.." \n \n" startSaveScrptLst(mycode,ldtbl2.myscrpt) for i,k in pairs(ldtbl2.myscrpt) do fullText = fullText..k.."\n" end end end if ldtbl2.cbcheck8==1 then if (slcode):find("") then if ldtbl2.cbcheck7==0 then fullText = fullText.." \n \n" else if not (mycode):find("") then fullText = fullText.." \n \n" end end startSaveScrptLst(slcode,ldtbl2.slscrpt) for i,k in pairs(ldtbl2.slscrpt) do fullText = fullText..k.."\n" end end end if ldtbl2.cbcheck5~=0 or ldtbl2.cbcheck6~=0 then fullText = fullText.."\n" end --print("fullText: "..fullText) return fullText end --###########################################################################-- --###########################################################################-- local tPath1 = getTempFolder().."testLoadTbl2.CT" function selectOptionsTables() if ldtbl2.slcOpt~=0 then fCode = addFullCode() if fCode then fCode = fCode.."\n" sl3 = createStringList() sl3.Text = fCode sl3.saveToFile(tPath1) if tPath1 then loadTable(tPath1) end sl3.Destroy() deleteFile(tPath1) end end end ldtbl2.lclFunc = selectOptionsTables --###########################################################################-- --###########################################################################-- mf = MainForm mnMenu = mf.Menu.Items miLdTblClk = createMenuItem(mf.mnMenu) miLdTblClk.Name = 'miLdTblClk' miLdTblClk.Caption = mnCpt44 mnMenu.insert(mnMenu.Count-1,miLdTblClk) miLdTblClk.OnClick = ldTableOptions --###########################################################################-- --###########################################################################--