Posted By: Reconnoiter
[SOLVED] File_str_readto with char* pointer - 10/17/16 11:28
Howdy,
I want to use a char* pointer for file_str_readto function so I can read-out larger text files (correct me if I misunderstood that).
But I can't seem to get it working with char*. What I basically want to do is read the large text file line by line.
This is what I had when using a STRING* to read the lines:
How to change it so file_str_readto use a char* instead of a STRING* and than copy's that read line to the STRING* ?
(I am mainly having difficulties resetting the char* and converting that 1 line to STRING*)
Thanks for taking the time.
I want to use a char* pointer for file_str_readto function so I can read-out larger text files (correct me if I misunderstood that).
But I can't seem to get it working with char*. What I basically want to do is read the large text file line by line.
This is what I had when using a STRING* to read the lines:
Code:
function read_line(var fHnd) { str_cpy(tmp_str, ""); //reset previous read lines file_str_readto(fHnd, tmp_str, "\n", 999999); //read next line str_trim(tmp_str); //remove spaces from value str_trunc(tmp_str, 1); //remove \n (/remove delimiter) }
How to change it so file_str_readto use a char* instead of a STRING* and than copy's that read line to the STRING* ?
(I am mainly having difficulties resetting the char* and converting that 1 line to STRING*)
Thanks for taking the time.