Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (dr_panther, Ayumi, 7th_zorro), 877 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
file_open_... #285280
08/17/09 22:27
08/17/09 22:27
Joined: Jul 2008
Posts: 170
Germany, near Mainz
Nicotin Offline OP
Member
Nicotin  Offline OP
Member

Joined: Jul 2008
Posts: 170
Germany, near Mainz
Ok, I couldn't find any other topic aout this problem and I begin to start that is is just such a dump failure from me again. Ok now this code:

Code:
str_cpy(path_str,"%EXE_DIR%\\Savegames\\");
	str_cat(path_str,"savegame.txt");
	filehandle_n = file_open_read(path_str);
	if(filehandle_n != 0)
	{
         do_something();
        }
	else
	{
		printf("Error!");
	}



I just get my Error message. But the folder and file exists!

I'm sure because

Code:
str_cpy(save_dir,"Savegames");
	str_cpy(path_str,"%SAVE_DIR%\\");
	str_cat(path_str,"savegame.txt");
	filehandle_n = file_open_read(path_str);
	if(filehandle_n != 0)
	{
         do_something();
        }
	else
	{
		printf("Error!");
	}


Works, I mean it is a good work-around but I don't want to have to switch the save_di for every file I load.

Version is 7.80

Last edited by Nicotin; 08/17/09 22:43.


Re: file_open_... [Re: Nicotin] #285284
08/17/09 22:33
08/17/09 22:33
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
PLEASE choose a different name for your string "path".
"path" is a pre-defined system variable in c-script, so you are using it in
an unnatural way, and this MAY be causing the problem.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: file_open_... [Re: EvilSOB] #285285
08/17/09 22:36
08/17/09 22:36
Joined: Jul 2008
Posts: 170
Germany, near Mainz
Nicotin Offline OP
Member
Nicotin  Offline OP
Member

Joined: Jul 2008
Posts: 170
Germany, near Mainz
Yeah sorry. Changed it but it still doesn't work. It doesn't work either if I just type "file_open_read("%EXE_DIR%\\Savegames\\savegame.txt");"



Re: file_open_... [Re: Nicotin] #285296
08/17/09 23:13
08/17/09 23:13
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Try it with just
file_open_read("Savegames\\savegame.txt");


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: file_open_... [Re: EvilSOB] #285297
08/17/09 23:15
08/17/09 23:15
Joined: Jul 2008
Posts: 170
Germany, near Mainz
Nicotin Offline OP
Member
Nicotin  Offline OP
Member

Joined: Jul 2008
Posts: 170
Germany, near Mainz
Ok this just worked. And I was sure that I already tryed it. Ok thank you hehe




Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1