Changes to string pointer?

Posted By: silencer

Changes to string pointer? - 04/24/09 19:44

Just upgraded to 7.73.1 and it seems that compared to my previous engine version that string pointers have changed.

I used to be able to pass string pointers like this:

Code:
 
	STRING* gonzo = "test_str.txt";
	
	readfile(gonzo);


Now it gives me "invalid pointer" or something similar when I try to run it. I can't find anything in the manual. What's changed?
Posted By: Widi

Re: Changes to string pointer? - 04/24/09 21:41

file_str_read and file_str_write don`t search now in the savedir. They search in the Projectfolder.
You can use:
STRING* gonzo = "my_savedir\\test_str.txt"
Posted By: EvilSOB

Re: Changes to string pointer? - 04/24/09 21:42

IF the line STRING* gonzo = "test_str.txt"; was INSIDE a function, it was always bad,
but would survive compile and sometimes testing, but its still bad.

STRING* gonzo = "test_str.txt"; syntax is for global strings (outside a function)
STRING* gonzo = str_create("test_str.txt"); syntax is for local strings (inside a function)

IF you are using STRING* gonzo = "test_str.txt"; syntax as a global string, then I dont know whats up,
(I only have 7.73.0 but I dont have any issues like this)
© 2024 lite-C Forums