Getting number of lines in file - 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: Getting number of lines in file (
/showthread.php?tid=662940)
Getting number of lines in file -
NoteND - 16.01.2019
Hey!
I'm currently working on converter that gets object model and coordinates from .map file and converts it into createdynamicobject.. now, Im wondering how do you check if map has been loaded.. meaning if all objects have been loaded.. I'm assuming you make Objects = 0 for example and everytime object is created you do Objects++.. but how do you check how many lines of objects are there in .map file in first place so you can check if(Objects = lines) later on.. Thank you in advance
Re: Getting number of lines in file -
NoteND - 17.01.2019
bump
Re: Getting number of lines in file -
Damian - 17.01.2019
https://www.computerhope.com/text-tool/
Re: Getting number of lines in file -
NoteND - 17.01.2019
Quote:
Originally Posted by ******
I would suggest storing the length in the first line. The problem with other checks is you are doing this to guard against file read issues, but if that's the case what is to stop file read issues when counting the lines?
|
I actually have no idea what you just wrote.. sorry, but can you re-read my question? I wanna get all lines starting with "<object" before any objects are created, so then I can count them and later on check if ObjectsCount is equal to lines starting with <object..
Re: Getting number of lines in file -
userid - 17.01.2019
You can use strfind and count CreateObjects