Actually the code I have is the one below. I would like to translate it to make the same but in memory, then when finish save it to disk.
Any help will be highly appreciated. Thanks!!

Code: Select all
OpenFile(6,file1$) ;open files
OpenFile(7,file2$)
Repeat
c$=ReadString(6) ;read every line of file1$$
WriteString(7,c$+Chr(10)) ;write the line to file2$
Until Left (c$,7)=Chr(9)+Chr(9)+"twist" ;until find twist
pos=Loc(7) ;file pointer
FileSeek (7,pos-Len(c$)) ;set the pointer a line up
WriteString (7,tg$+c$+Chr(10)) ;add the variable tg$ to the file (the length of this variable is unknown
;when you Allocate memory to the begining). It can be from 10 k. until 2/3 meg.
;not sure if the memory allocated can be modified when knowing the value of this
;variable. This value is different every time that the programa calculates it
;and it will be inserted in the second file a lot of times during the program
;execution. Say that if the original file1$ is 100 k. big, file2$ would be at the
;end of the program about 50 or 100 meg. big
Repeat
c$=ReadString(6) ;read every line of file1$$
WriteString(7,c$+Chr(10)) ;write the line to file2$
Until Eof(6) ;until end of file
CloseFile (6) ;close files
CloseFile (7)