Getting number of lines in file
#1

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
Reply
#2

bump
Reply
#3

https://www.computerhope.com/text-tool/
Reply
#4

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..
Reply
#5

You can use strfind and count CreateObjects
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)