I'm trying to figure out why the arrays is not following like it's suppose to or at least I think it should. See code below:
try(destroyDialog test)catch()
rollout test "test"
(
editText fileinfo_lb "Info/Selected File Info:" height:50 align:#right readOnly:true
multiListBox maxFiles_mlb "Select Max Files to Process:"
button browseProcess_bt "Browse Directory" align:#left across:2
checkBox recurse_cb ":Recursive" checked:true align:#center
editText processDir_et ":" fieldWidth:780 align:#right
Fn getMaxFiles_fn dir = (
if recurse_cb.checked then (
local dir1 = getDirectories (dir + "*")
for d in dir1 do (
join dir1 (getDirectories (d + "*"))
)
local files = #()
for f in dir1 do (
join files (getFiles (f + "/*.max"))
)
join files (getFiles (dir + "\*.max"))
return files
)else (
files = (getFiles (dir + "\*.max"))
return files
)
)
on browseProcess_bt pressed do (
if processDir_et.text == "" then (
path = getSavePath caption:"Choose Directory for Scripts" initialDir:maxFilePath
if path != undefined then (
processDir_et.text = path
getMaxFiles_fn path
maxFiles_mlb.items = (getMaxFiles_fn processDir_et.text)
)
)
else if processDir_et.text != undefined then (
path = getSavePath caption:"Choose Directory for Scripts" initialDir:processDir_et.text
if path != undefined then (
processDir_et.text = path
getMaxFiles_fn path
maxFiles_mlb.items = (getMaxFiles_fn processDir_et.text)
)
)
)
on maxFiles_mlb selected i do (
--fileinfo_lb.text = fileNameFromPath (maxFiles_mlb.items[i])
print maxFiles_mlb.items[i] -- = fileinfo_lb.text as string
--print (maxFiles_mlb.items[i])
)
)
createDialog test 800 270 style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)
Should:
print maxFiles_mlb.items[i]
Not follow the array and print the name of the currently selected file to the listener?
Thanks in advance
By 3dwannab · 2015-06-23