Hi there, is it possible to set properties with a variable?
Have a Screen with 4 Checkboxes. On preload it should check whether files exist and activate a box (1 file = 1 box).
Tryed this, but don´t work...
Any other idea?
Have a Screen with 4 Checkboxes. On preload it should check whether files exist and activate a box (1 file = 1 box).
Tryed this, but don´t work...
Code:
files = {"file1.exe","file2.exe","file3.exe","file4.exe"}; boxes = {"CTRL_CHECK_BOX_01", "CTRL_CHECK_BOX_02", "CTRL_CHECK_BOX_03", "CTRL_CHECK_BOX_04"}; for j,k in pairs(files) do if File.DoesExist(k) then DlgCheckBox.SetProperties(boxes[j], {Enabled = true, Checked=true}); else DlgCheckBox.SetProperties(boxes[j], {Enabled = false, Checked=false}); end end
Code:
--This works, but is to long... if File.DoesExist(files[1]) then DlgCheckBox.SetProperties(CTRL_CHECK_BOX_01, {Enabled = true, Checked=true}); else DlgCheckBox.SetProperties(CTRL_CHECK_BOX_01, {Enabled = false, Checked=false}); end if File.DoesExist(files[2]) then DlgCheckBox.SetProperties(CTRL_CHECK_BOX_02, {Enabled = true, Checked=true}); else DlgCheckBox.SetProperties(CTRL_CHECK_BOX_02, {Enabled = false, Checked=false}); end ---...
Comment