|
[SOLVED] File_str_readto with char* pointer
#462626
10/17/16 11:28
10/17/16 11:28
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
OP
Serious User
|
OP
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
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:
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.
Last edited by Reconnoiter; 10/17/16 19:01.
|
|
|
Re: File_str_readto with char* pointer
[Re: txesmi]
#462643
10/17/16 19:10
10/17/16 19:10
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
OP
Serious User
|
OP
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
Hi txesmi, tnx for replying, I know what it is now. I added a periodic wait to the function cause the engine can't create >1000 objects with an initialization action at the same time. But in doing so I forgot that in an other function the file got closed. Sry for the confusion. Also I pleasantly suprised in the loading speed from a text file, seems only ent_create really eats some fps away which is to be expected with e.g. 2500 ents. offtopic: by the way do you also have any game projects your are currently working on or planning on to release? I would be interested to see what you can make.
Last edited by Reconnoiter; 10/17/16 19:12.
|
|
|
Re: File_str_readto with char* pointer
[Re: Reconnoiter]
#462663
10/19/16 14:07
10/19/16 14:07
|
Joined: Jun 2007
Posts: 1,337 Hiporope and its pain
txesmi
Serious User
|
Serious User
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
|
are currently working on or planning on to release? Not really, I always lacked the necessary artist. I am looking forward!
|
|
|
|