Hello Forum,
it looks like I am stuck again frown .

I have a text document with a lot of vars, listed like in this example:
Quote:

$obj_stuff1 = Apple;
$obj_stuff2 = Banana;
$obj_stuff3 = Pear;
$obj_stuff4 = Orange;


I can successfully read out the file and always find what I am searching for.

What I am trying to do now is, I want to change a certain line, or just replace it.
For example, I want to change
Quote:
$obj_stuff4 = Orange;

into
Quote:
$obj_stuff4 = Mango;


This means that I need to open the txt-file, place the reading-pointer after
Quote:
$obj_stuff4 =

and then overwrite the word 'Orange' with the word 'Mango'.
Basically I could also just delete the whole line and replace it with the new one.

I am not even sure if 3D Gamestudio 7.5 is capable of something like that, but here is what I tried so far:
Quote:

//Open the file
var filehandle = file_open_game(_chr(filepath));

//Find the '$obj_stuff4'
file_find(filehandle,selected_obj);

//Place the read/write pointer 3 bytes behind for the ' = '
file_seek (filehandle, 3, 1);

//Write my stuff
file_str_write(filehandle,new_string_to_write);
file_close(filehandle);


Of course this does not work and I am not completely sure about everything aswell.
Is there any way to achieve what I am trying to do?

There might be better solutions for storing my data but I really would prefer if I could keep my txt in the same format laugh

Yours truly,
Yking