Gamestudio Links
Zorro Links
Newest Posts
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 827 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 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