Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,425 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
if filehandle is zero #281799
07/28/09 18:39
07/28/09 18:39
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline OP
User
Ottawa  Offline OP
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

I'm creating a situation where my file .txt has disappeared from the folder.
The stats for the game are no longer available.

This is what I have :
Code:
var filehandle;
...
function check_file_existence ()
{
	filehandle = file_open_read ("gameresults_1.txt");
	if (filehandle > 0)
	{
		do
	}
	else
	{
		do
	}
}



The engine does not find the file and says so.
Quote:

W1518 Can't find file ..................


What is the correct code for this situation?

Re: if filehandle is zero [Re: Ottawa] #281804
07/28/09 19:32
07/28/09 19:32
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline
User
Stromausfall  Offline
User

Joined: Dec 2002
Posts: 616
Austria
you should check txt_for_dir !


get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread
Re: if filehandle is zero [Re: Stromausfall] #281809
07/28/09 19:51
07/28/09 19:51
Joined: Jul 2008
Posts: 170
Germany, near Mainz
Nicotin Offline
Member
Nicotin  Offline
Member

Joined: Jul 2008
Posts: 170
Germany, near Mainz
I don't see whats wrong there. My code is:

Code:
filehandle_n = file_open_read (Map_name); //öffne Map.txt
	if(filehandle_n != 0)//falls es existiert
	{
          do something
        }
        else
        {
          printf("Map existiert nicht!");
        }



and it works finem even without file. I think that problem is in an other part of your code



Re: if filehandle is zero [Re: Nicotin] #281813
07/28/09 20:04
07/28/09 20:04
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline
User
Stromausfall  Offline
User

Joined: Dec 2002
Posts: 616
Austria
hmmm you're right, but i think i know now why you get these messages.
Did you set warn_level to 3 ?
In the manual under warn_level :
0 - no warning messages.
1 - warnings about problems with some hardware configurations (default).
2 - warnings about bad texture sizes and wrong parameters in engine functions.
3 - warnings about missing files in file functions.
4..6 - even more warnings.

so you probably have warn_level at 3 or higher and everything works as planned ^^


get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread
Re: if filehandle is zero [Re: Stromausfall] #281816
07/28/09 20:22
07/28/09 20:22
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline OP
User
Ottawa  Offline OP
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!
Nicotin : I have the same code as you.

Stromausfall : Yes my warn_level is very high.

I tested it with a lower level (2) and it works wink

I wouldn't of found this. Thanks.


Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C
Re: if filehandle is zero [Re: Ottawa] #281822
07/28/09 20:41
07/28/09 20:41
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline
User
Stromausfall  Offline
User

Joined: Dec 2002
Posts: 616
Austria
no problem ^^


get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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