Posted By: EvilSOB
Whats up with "file_str_writeto"? - 12/15/09 14:48
Dunno if this belongs in "Blame the Manual" but cant see where else it fits.
Is the "file_str_writeto" function in experimental stage or something?
Its listed in the manual with "file_str_write" and there is no mention of experimental there.
And if I include it in my code I get "undeclared identifier" errors.
And I cant find any reference to it in "Bugs".
[PS:: Im running 7.80.0 commercial]
So whats the go guys ....?
Thx.
Posted By: jcl
Re: Whats up with "file_str_writeto"? - 12/16/09 09:57
You're right, this function was indeed missing in the header (afuncs.h).
If you need it now, you can add it yourself:
EXT_var F(file_str_writeto)(var handle,char*,var length);
Posted By: EvilSOB
Re: Whats up with "file_str_writeto"? - 12/16/09 13:06
When I try that I just get an "empty prototype" error on execution.
FYI:: The code Im using is as follows...
file_str_writeto(f, (char*)player.skill5, sizeof(CAR));
Where
var f = file_open_write(...);
typedef struct{...}CAR;
player.skill5 = sys_malloc(sizeof(CAR));
Sounds like this is something more than just a missing header entry.
Looks like I may need to wait for the next public release...
Posted By: Bunsen
Re: Whats up with "file_str_writeto"? - 12/16/09 13:52
Copy the 2 lines to your code before calling the function:
API(file_str_writeto,acknex)
var file_str_writeto(var,char*,var);
Posted By: EvilSOB
Re: Whats up with "file_str_writeto"? - 12/16/09 14:39
Ive written my own read and write versions now, no biggie.
file_str_writeto now works but keeps terminating the buffer-read early
even though I specify "" as delimiter (ie no delimiter).
Dunno if its actually a bug or not, cause I didnt test it very thoroughly.
It is interesting that Bunsens 2 lines allows compile and execution,
but JCL's one liner doesnt...
Anyone know why? Just curious, as Ive written new code now.
Its not a time-critical area so in-efficient code is not important...
Posted By: MichaelGale
Re: Whats up with "file_str_writeto"? - 12/16/09 18:26
I might be wrong, but shouldn't it be
EXT var
rather than
EXT_var
?
Posted By: EvilSOB
Re: Whats up with "file_str_writeto"? - 12/16/09 21:49
Yeah, it was MichaelGale.
I guess JCL put in the "_" to show a required space.