Help with FileReadString

 

Sometimes I don't want to read the entire string in my file.

I just need to read the 5th character and stop at the say the 10th.

The string can have in access of 100 characters, and no delimiters.

May sound strange, but there is a reason for no delimiters - so i cant use them in this case.

FileReadString( int handle, int length=0)

The function reads the string from the current file position

So I can find a starting point but how would I stop at character 10?

Is this possible?


I thought of using

int StringLen( string text) 
Returns character count in a string. 

But I'm afraid this might bog things down, since i have a lot of characters to read when doing it this way

So I was looking for some easier solution if available.

Thanks

 
string whatever = FileReadString(handle);
string mydata = StringSubstr(whatever,5,5);
Print ("the data i want is: ", mydata);
 

qjol, thanks buddy!

I had no idea it was this easy. Reading files is a new road for me.

Thanks for the help :) !!!

Reason: