Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
1 registered members (Grant), 999 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
open txt file from wrs ressource and change it #397382
03/18/12 16:32
03/18/12 16:32
Joined: Aug 2008
Posts: 394
Germany
Benni003 Offline OP
Senior Member
Benni003  Offline OP
Senior Member

Joined: Aug 2008
Posts: 394
Germany
Hello, please help me in something.
I want to load and read a text file wich is packed into a wrs ressource. After this I want to write some variables into it and save it. Could someone give tell me wich commands I hove to write to do this?

Re: open txt file from wrs ressource and change it [Re: Benni003] #397388
03/18/12 17:32
03/18/12 17:32
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Manual --> Engine Funktionen --> Datei Funktionen

There are all commands for file manipulation.

PS: Das hättest du auch selber finden können, oder nicht? wink

Last edited by Widi; 03/18/12 17:33.
Re: open txt file from wrs ressource and change it [Re: Widi] #397391
03/18/12 18:12
03/18/12 18:12
Joined: Aug 2008
Posts: 394
Germany
Benni003 Offline OP
Senior Member
Benni003  Offline OP
Senior Member

Joined: Aug 2008
Posts: 394
Germany
Hello Widi, I know the commands for file manipulation. My problems are:
How to open a textfile wich is packed into a wrs file and how to save it into this wrs file.
Thank you.

Ja, bevor ich hier etwas schreibe schaue ich natürlich im Handbuch nach wink

Re: open txt file from wrs ressource and change it [Re: Benni003] #397392
03/18/12 18:24
03/18/12 18:24
Joined: Sep 2009
Posts: 987
Budapest
Aku_Aku Offline
User
Aku_Aku  Offline
User

Joined: Sep 2009
Posts: 987
Budapest
add_resource in the Manual.

Re: open txt file from wrs ressource and change it [Re: Aku_Aku] #397395
03/18/12 18:36
03/18/12 18:36
Joined: Apr 2005
Posts: 4,506
Germany
F
fogman Offline
Expert
fogman  Offline
Expert
F

Joined: Apr 2005
Posts: 4,506
Germany
You can´t save to wrs at runtime. You have to copy the file via file_cpy out of the wrs, then you can alter it and save it. The engine will use this file from now on, not the one in the wrs. However, it´ll be visible to everyone, then.

Maybe you can encrypt it.

Manual (@file_cpy)
Quote:

For copying a text file from a .wrs resource, rename the file to "*.pak" and add it to the resource with a BIND statement in a .wdl file, or a PRAGMA_BIND in a .c file (f.i. #define PRAGMA_BIND "mytext.pak";). At runtime, copy the text file from the resource with file_cpy("mytext.txt","mytext.pak");. The resource must either exist in the work folder, or be opened by add_resource.



no science involved
Re: open txt file from wrs ressource and change it [Re: fogman] #397400
03/18/12 19:59
03/18/12 19:59
Joined: Aug 2008
Posts: 394
Germany
Benni003 Offline OP
Senior Member
Benni003  Offline OP
Senior Member

Joined: Aug 2008
Posts: 394
Germany
ok, thank you guys. I will do it in an other way without wrs. file laugh

Re: open txt file from wrs ressource and change it [Re: Benni003] #397413
03/18/12 22:09
03/18/12 22:09
Joined: Aug 2008
Posts: 394
Germany
Benni003 Offline OP
Senior Member
Benni003  Offline OP
Senior Member

Joined: Aug 2008
Posts: 394
Germany
Now it's good working:) Here how I did it:

file_cpy("test.txt","test.pak");

var status_file = file_open_read("test.txt");

v_mission=file_var_read(status_file);

file_close(status_file);

file_delete("test.txt");

the file "test.pak" is packed into a wrs file.

Last edited by Benni003; 03/18/12 22:09.

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