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
Write txt file in program files, not allowed in vista! #296893
11/03/09 18:19
11/03/09 18:19
Joined: Nov 2003
Posts: 433
The Netherlands
T
Toon Offline OP
Senior Member
Toon  Offline OP
Senior Member
T

Joined: Nov 2003
Posts: 433
The Netherlands
Code:
var save_handle;

function save_settings()
{		
  save_handle = file_open_write("resolution.txt");
	
  file_var_write(save_handle,resolution);

  file_close(save_handle);
}



We made a save system in our game based on code like this right up here. We really want to install the game in the program files folder but Vista seems to have a problem with reading and writing files like that in that folder.

It says "Empty pointer in"E1415, invalid pointer or handle in".

Anyone knows a solution to this?

Re: Write txt file in program files, not allowed in vista! [Re: Toon] #296976
11/04/09 03:26
11/04/09 03:26
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
btw, the error is E1514.

There is no error in the code, if u have defined resolution as a variable. please check that. rest of the code is fine.

And check that the folder u writing to has permissions.


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Re: Write txt file in program files, not allowed in vista! [Re: delinkx] #297206
11/05/09 23:44
11/05/09 23:44
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline
Expert
Locoweed  Offline
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
I don't know what your issue is, but writing .txt files in Vista does work.


Professional A8.30
Spoils of War - East Coast Games
Re: Write txt file in program files, not allowed in vista! [Re: Locoweed] #297211
11/06/09 00:04
11/06/09 00:04
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

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

Please explain

file_var_write(save_handle,resolution);

Where and what is resolution?....this might be the problem.


Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C
Re: Write txt file in program files, not allowed in vista! [Re: Ottawa] #297433
11/07/09 15:09
11/07/09 15:09
Joined: Nov 2009
Posts: 34
S
Sepiantum Offline
Newbie
Sepiantum  Offline
Newbie
S

Joined: Nov 2009
Posts: 34
I'm pretty sure it works. I currently do not have windows vista because it fails. I have windows xp. Did you try to run it as Administrator? I'm pretty sure that normal users cannot write to program files. Try writing to documents instead? If writing to documents works and not program files, then it's your account limits that restricts you.

*EDIT*
For the file you are writing to, change it to: "C:\\Program Files\\resolution.txt"
I'm sure that Lite-C doesn't know where to open the file. If that doesn't work, then it's the problem I explained above. Oh, if you don't know why I have \\ instead of \, it is because strings have escape sequences. \n is newline, \t is tab, etc. And because of that, \ doesn't mean anything unless if you put a character in front of it. Which means you need \\ to have \ in the actual string.

Last edited by Sepiantum; 11/07/09 15:17.

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