G
Guest
hello everybody,
i'm having some problems searching a text file and then deleting the line.
since i used fileopen(), i can use the eof() function to loop through the
file, searching for the specified line. the problem is, once found, i can't
delete it because the filemode is in openmode.input.
is there a way to chance the openmode on the run?(if so, what is it?)
and maybe there is a simpler way to search a text file and deleting the line?
this is the code so far:
<begin code>
Dim foto As String = fotos.Item(positionarray)
Dim arrayitem, line As String
FileOpen(4, cpath & albumpath & album, OpenMode.Input)
Do While Not EOF(4)
line = LineInput(4)
If line = foto Then
FileClose(4)
PrintLine(4, "")
MsgBox("deleted line!")
Exit Do
End If
Loop
FileClose(4)
<end code>
any help would be greatly appriciated![Smile :) :)](/styles/default/custom/smilies/smile.gif)
thanks,
i'm having some problems searching a text file and then deleting the line.
since i used fileopen(), i can use the eof() function to loop through the
file, searching for the specified line. the problem is, once found, i can't
delete it because the filemode is in openmode.input.
is there a way to chance the openmode on the run?(if so, what is it?)
and maybe there is a simpler way to search a text file and deleting the line?
this is the code so far:
<begin code>
Dim foto As String = fotos.Item(positionarray)
Dim arrayitem, line As String
FileOpen(4, cpath & albumpath & album, OpenMode.Input)
Do While Not EOF(4)
line = LineInput(4)
If line = foto Then
FileClose(4)
PrintLine(4, "")
MsgBox("deleted line!")
Exit Do
End If
Loop
FileClose(4)
<end code>
any help would be greatly appriciated
![Smile :) :)](/styles/default/custom/smilies/smile.gif)
thanks,