local formspec = "textlist[0,0;7,5;mydir_list;"
local files = minetest.get_dir_list("PATH")
for i = 1, #files do
formspec = formspec .. files[i] .. ","
end
formspec = formspec .. "]"Krock wrote:You can do it like this:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
local formspec = "textlist[0,0;7,5;mydir_list;"
local files = minetest.get_dir_list("PATH")
for i = 1, #files do
formspec = formspec .. files[i] .. ","
end
formspec = formspec .. "]"
endev15: https://github.com/minetest/minetest/bl ... .txt#L1826
endev15 wrote:Krock wrote:You can do it like this:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
local formspec = "textlist[0,0;7,5;mydir_list;"
local files = minetest.get_dir_list("PATH")
for i = 1, #files do
formspec = formspec .. files[i] .. ","
end
formspec = formspec .. "]"
endev15: https://github.com/minetest/minetest/bl ... .txt#L1826
Thanks! I didn't see it in the dev wiki, so... I actually really need this for my computer mod, and it's definitely more stable then os.execute. From what I see, this returns an array and then you cycle through the array to create the list? I guess I could to the same thing for textareas, couldn't I...
Byakuren wrote:You should check lua_api.txt, since it is more complete than the wiki.
endev15 wrote:Byakuren wrote:You should check lua_api.txt, since it is more complete than the wiki.
Yeah, I should. Will try and make that more of a habit. Maybe I'll invent some way to format it nicely... Some type of "API Display Program." LOL
Krock wrote:You can do it like this:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
local formspec = "textlist[0,0;7,5;mydir_list;"
local files = minetest.get_dir_list("PATH")
for i = 1, #files do
formspec = formspec .. files[i] .. ","
end
formspec = formspec .. "]"
endev15: https://github.com/minetest/minetest/bl ... .txt#L1826
Krock wrote:You can do it like this:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
local formspec = "textlist[0,0;7,5;mydir_list;"
local files = minetest.get_dir_list("PATH")
for i = 1, #files do
formspec = formspec .. files[i] .. ","
end
formspec = formspec .. "]"
endev15: https://github.com/minetest/minetest/bl ... .txt#L1826
local files = minetest.get_dir_list("PATH")
local formspec = "textlist[0,0;7,5;mydir_list;" .. table.concat(files, ",") .. "]"local formspec = "textlist[0,0;7,5;mydir_list;" .. table.concat(minetest.get_dir_list("PATH"), ",") .. "]"Users browsing this forum: No registered users and 3 guests