Any way to get a list of Resources, that were set in the IDE, during runtime? lazarus / 9-Editor ---------------------------------------------------------------------- wpflum · 2020-09-03 18:39 I'm not sure I worded this correctly so here goes.  I want to add several small rtf files to the program to use as templates and want to make it easy to add or change them in the future.  When I found out I could add them in using the IDE, Project Options, Resources, screen I did and was able to get them from the program then.  The problem is that is if I add more or change the names of the files it looks like I have to modify the code reading them.  What I'd like to do is create a class that will return the number of templates along with their names but I can't seem to find a way to get a count or a list of the names without manually adding them into the code.  What I'd like is to just add files to a subdirectory and then tell the ide that these are to be included and not have to change code.   Is there any way to do this? ---------------------------------------------------------------------- TRon · 2020-09-03 18:58 Quote from: wpflum on September 03, 2020, 08:39:03 pm Is there any way to do this? Sure  Create a directory structure on disk and place your rtf templates where you'd like them to end up. Now use the zip command to zip the templates into a zip-file. Add that zipfile as a resource, and load/examine the archive using TUnzipper. ---------------------------------------------------------------------- wpflum · 2020-09-03 19:21 That would work, I was hoping for a little more elegant design what with the resources being in set in the IDE. If nothing else pops up I'll do it that way. Thanks. ---------------------------------------------------------------------- Handoko · 2020-09-03 19:49 I remember there was a similar question like yours recently, maybe it can be useful for you: https://forum.lazarus.freepascal.org/index.php/topic,51037.msg374117.h tml#msg374117 ---------------------------------------------------------------------- wpflum · 2020-09-03 20:00 All the link does is send me to the main forum screen and searching for the message number, 374117, just finds your post. ---------------------------------------------------------------------- Zoran · 2020-09-03 21:06 Quote from: wpflum on September 03, 2020, 10:00:27 pmAll the link does is send me to the main forum screen and searching for the message number, 374117, just finds your post. Handoko's link works for me... Anyway, you don't need the message number, only topic number (which is 51037) is important. Perhaps surrounding in "url" tags might help you? Try: https://forum.lazarus.freepascal.org/index.php/topic,51037.html ---------------------------------------------------------------------- wpflum · 2020-09-04 13:11 Weird, I read this message on my iPad at home and was able to click the link and get there but this morning at work both Chrome and Edge just show me the main forum screen.  I was able to search for the topic number and find it again.  I did see this and tried it but was having issues but I'll give it a shot again. ---------------------------------------------------------------------- wpflum · 2020-09-04 13:29 I remember now, this uses a res file but when I add them in using the IDE I don't seem to have that. ---------------------------------------------------------------------- wpflum · 2020-09-04 17:33 Ok, found out the system was creating a res file when I added the files, not sure how I missed that, and using some of the code from that older topic I'm able to generate a list of the resources and use is to populate the class object. Thanks for the help.