[GEM Development] GDScript commands

Heinz Rath heinz.rath at gmx.at
Sat Aug 13 11:35:26 PDT 2005


hi

if i remeber correctly the READ command works after a OPEN file
command and the WRITE command works only after a CREATE file command.
So you cant call READ and WRITE on a file at the same time.

This means if you for example want to read a file with 3 lines.
and save one line in a changed style you could do this so.

OPEN file.txt
READ %1
READ %2
READ %3
CLOSE

LET %2="ChangeD"
CREATE file.txt
WRITE %1
WRITE %2
WRITE %3
CLOSE

this would change the second line of the file.
i hope this helps.

with nice greetings
heinz

BC> Hi.  Just wondering if it is possible to read and write specific lines
BC> of|to a file using GDScript.  Example: Read %1 ;read the first line of
BC> a file
BC> Write some text ;write some text to the first line of a file
BC> Read %2 ;read the second line of a file

BC> etc...

BC> Anyone?
BC> _______________________________________________
BC> gem-dev mailing list
BC> gem-dev at simpits.org
BC> http://www.simpits.org/mailman/listinfo/gem-dev



More information about the gem-dev mailing list