Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (SBGuy), 652 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[Help] Save_dir #443090
07/09/14 03:43
07/09/14 03:43
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Code:
str_cpy(save_dir,"C:\\ProgramData\\DLively\\Subfolder\\save_dir")

filehandle = file_open_write ("%SAVE_DIR%\\scores.txt");
if(filehandle == 1){
		
	file_str_write(filehandle,end_input_name_str_i);
	file_str_write(filehandle,",");
	file_str_write(filehandle,end_name_1_str_i);
	file_str_write(filehandle,",");
	file_str_write(filehandle,end_name_2_str_i);
	file_str_write(filehandle,",");
	file_str_write(filehandle,end_name_3_str_i);
	file_str_write(filehandle,",");
		
	file_str_write(filehandle,input_name_str_i);
	file_str_write(filehandle,",");
	file_str_write(filehandle,name_1_str_i);
	file_str_write(filehandle,",");
	file_str_write(filehandle,name_2_str_i);
	file_str_write(filehandle,",");
	file_str_write(filehandle,name_3_str_i);
		
	file_close (filehandle); 
}
else beep();



This worked once and created the file in this directory - Then I deleted it to see if it would do it again - and no. not only that, but nothing was inputted inside.

Last edited by DLively; 07/09/14 03:45.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: [Help] Save_dir [Re: DLively] #443111
07/09/14 15:32
07/09/14 15:32
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Okay,this crates the scores.txt, but does not fill in the scores.txt with the required fields:

filehandle = file_open_write ("C:\\ProgramData\\DLively\\Subfolder\\save_dir\\scores.txt");
if(filehandle == 1){

file_str_write(filehandle,end_input_name_str_i);
file_str_write(filehandle,",");

Last edited by DLively; 07/09/14 15:32.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: [Help] Save_dir [Re: DLively] #443112
07/09/14 15:44
07/09/14 15:44
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
HI,
the filehandle variable value will probably change each run and it will probably never be equal to one.

Code:
if ( filehandle != 0 )
{...



Salud!

Re: [Help] Save_dir [Re: txesmi] #443125
07/09/14 18:41
07/09/14 18:41
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Ah there we go laugh

That was the issue, Thank you much txesmi


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: [Help] Save_dir [Re: DLively] #476341
02/19/19 19:03
02/19/19 19:03
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline
User
Dooley  Offline
User

Joined: May 2005
Posts: 868
Chicago, IL
I can't seem to get my game to create a folder. Does this script create a folder, or just create a file into an existing folder?


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