I am not sure what your doing but this might be it
[code=thinbasic]
uses "file","UI"
dim nfile as string
dim nfileName as string
dim sfilter as string
sfilter = "Text files (*.txt)| *.txt|"
sfilter += "all files (*.*)|*.*"
nfileName = dialog_openfile(0, "open a new file",dir_getcurrent , sfilter, "Txt", %ofn_filemustexist or %ofn_hidereadonly or %ofn_enablesizing)
IF nFileName = "" THEN MSGBOX 0, "No File Selected" : STOP ' If no file selected then exit
nFileName = REMAIN$ ( -1,nFileName, "\" ) ' This will remove the directories
' and leave just the filename and extension
nFile = File_LOAD(APP_SOURCEPATH+nFileName) ' Load the File
IF nFile = "" THEN MSGBOX 0, "File empty" : STOP ' if the file is empty message and exit
nFile = replace$( Ucase$(nFile), "ZUCCHERO", "zucherox") ' This will convert the text to uppercase and replace
' the required string
file_save(app_sourcepath+"OutPut"+nFileName, MCASE$(nFile)) ' Save the text to a file and convert to mixed case.
msgbox 0, "Finished"
[/code]
Bookmarks