SA-MP Forums Archive
Listing textual items from folder - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Listing textual items from folder (/showthread.php?tid=664909)



Listing textual items from folder - Suttix - 15.03.2019

Hi.

I'd like to read and write all textual .ini files from folder using for loop but I don't know how.
Is there any way to parse those files like you parse IDs from folder. Thanks a lot.


Re: Listing textual items from folder - NaS - 16.03.2019

You can use a plugin to get a list of the files, then loop through them.

For example https://sampforum.blast.hk/showthread.php?tid=653119

There's an example in the thread to show how to loop through a directory.

Alternatively, if it's a thing you want to do only once, you can use a .bat file to generate a file list, open that file with the file functions and loop through that.

Although the first option should be more convenient.


Re: Listing textual items from folder - Suttix - 19.03.2019

Quote:
Originally Posted by NaS
Посмотреть сообщение
You can use a plugin to get a list of the files, then loop through them.

For example https://sampforum.blast.hk/showthread.php?tid=653119

There's an example in the thread to show how to loop through a directory.

Alternatively, if it's a thing you want to do only once, you can use a .bat file to generate a file list, open that file with the file functions and loop through that.

Although the first option should be more convenient.
Thanks mate, i'll try it