ID:263602
 
Code:
If(“Edit”)
var/Choice=input(“Which file do you wish to edit?”,”Edit”) in usr.PPages
switch(Choice)
if(“Exit”)
return
else
var/E=file2text(Choice)
var/Edit=input(“Edit Code(PHP, PERL, and CGI are not supported","Edit",E) as message
text2file(E,Choice)


Problem description:When I click ok and the text is wrote to the file, instead of modifying the code the leaves the old but also inserts the new code under it, how can I fix this and is there a more efficient way of modifying files, this code might not be spaced right i had to rewrite it at school in notepad.

Just use fexists and fdel to delete the file before you write to it.
In response to CaptFalcon33035
Thank you that worked.