SA-MP Forums Archive
Weird huh? - what does fopen return? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Weird huh? - what does fopen return? (/showthread.php?tid=392418)



Weird huh? - what does fopen return? - Dr.Einstein - 14.11.2012

This isn't important, but if you know about it, enlighten us.

If you try:
Код:
new File:f;
f=fopen("ss.txt",io_read);
printf("%d",f);//you will get a warning here..
It will always return a 7-digit value starting with 5093.

On the other hand, if you try this:
Код:
printf("%d",fopen("ss.txt",io_read));
You will get: 51996***

The same thing is for all file modes..
Why?


Re: Weird huh? - what does fopen return? - Vince - 14.11.2012

Just a value to identify the file in other functions. Why do you care anyway?
I also think the value is somehow determined from the current time, to make sure it is different at all times.


Re: Weird huh? - what does fopen return? - Dr.Einstein - 14.11.2012

It's a good thing to know about functions that you use all the time..


Well, the values go up and down.. no matter what the time is.. I don't really think that's the case though. At first I thought it was the location of the file, or the file name, but that made no difference..