Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/19/24 18:45
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
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, kzhao, 7th_zorro), 714 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Question to strings #351524
12/26/10 14:03
12/26/10 14:03
Joined: Sep 2009
Posts: 496
P
Progger Offline OP
Senior Member
Progger  Offline OP
Senior Member
P

Joined: Sep 2009
Posts: 496
Hi COmmunity i have a problem
a Textfile contains for example "World"
and i want to add a "Hello" infont of it

but i can onl use
file_open_write
the problem is that it will delete the "World" before

file_open_append then it will look like that : "World" "Hello"

and file_open_read to read it

i found out that file_Seek controls where the text should start
but it works only with file_read

so what can i do?
i dont want to first save the "World" string before just want to put a "Hello" infont of it without changing th rest

Thanks for your help laugh
WFG Progger laugh



Last edited by Progger; 12/26/10 14:08.

asking is the best Way to get help laugh laugh laugh
Re: Question to strings [Re: Progger] #351530
12/26/10 16:16
12/26/10 16:16
Joined: Dec 2010
Posts: 224
NRW, Germany
NeoJones Offline
Member
NeoJones  Offline
Member

Joined: Dec 2010
Posts: 224
NRW, Germany
sry, i dont understand your problem... but my english is bad, too.

mfg, DF


Errors are the engine of progress.

Version: A8 Commercial
OS: Win 7 64bit
Models: Cinema 4D
Re: Question to strings [Re: NeoJones] #351533
12/26/10 17:25
12/26/10 17:25
Joined: Sep 2009
Posts: 496
P
Progger Offline OP
Senior Member
Progger  Offline OP
Senior Member
P

Joined: Sep 2009
Posts: 496
Does someone has an answer for me?
THanks for ur help laugh


asking is the best Way to get help laugh laugh laugh
Re: Question to strings [Re: Progger] #351537
12/26/10 17:54
12/26/10 17:54
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
Create a third string to display it?

STRING* strPrefix;
STRING* strSuffix;
STRING* strDisplay;

strPrefix = str_create("Hello ");
strSuffix = file_open_write("filename.txt");

str_cpy(strDisplay, strPrefix);
str_cat(strDisplay, strSuffix);

display will contain "Hello World" and not change either suffix or prefix

Re: Question to strings [Re: MrGuest] #351548
12/26/10 21:02
12/26/10 21:02
Joined: Sep 2009
Posts: 496
P
Progger Offline OP
Senior Member
Progger  Offline OP
Senior Member
P

Joined: Sep 2009
Posts: 496
No i want to save it in my txt file
and dont want to change World it shell stand there
i only want to add "Hello" infrontofit
But thanks Mr Guest for the answer laugh

Last edited by Progger; 12/26/10 21:03.

asking is the best Way to get help laugh laugh laugh

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