Ovalx,
Here is an example using QStringList to edit a text file line content.
$APPTYPE CONSOLE
DIM lst AS QSTRINGLIST
lst.additems "this is line 1",_
"this is line 2",_
"this is line 3"
lst.savetofile("testline.txt")
lst.clear
showlist:
WITH lst
.loadfromfile("testline.txt")
?
?"List of content testline.txt"
?"----------------------------"
?.text
?"----------------------------"
INPUT "press enter to continue...";k$
END WITH
IF isdone THEN GOTO jumpequal
editline = 3
new3$ = lst.item(editline-1) + " was edited"
lst.insertitem editline-1, new3$
lst.delitems editline
lst.savetofile("testline.txt")
isdone = 1
GOSUB showlist
jumpequal:
lst.clear
END
greetings,
don. |