acana007 Posted May 11, 2008 Posted May 11, 2008 i need help with my file dialog it works kinda $var = FileSaveDialog( "Choose a name." & ".txt", $MyDocsFolder, "blah (*.txt)", 2) FileWrite($var, $var2 & $var3) this is what it currently is and it works except it won't append the .txt to the end of the file how do i get it to do that?
monoceres Posted May 11, 2008 Posted May 11, 2008 acana007 said: i need help with my file dialog it works kinda $var = FileSaveDialog( "Choose a name." & ".txt", $MyDocsFolder, "blah (*.txt)", 2) FileWrite($var, $var2 & $var3) this is what it currently is and it works except it won't append the .txt to the end of the file how do i get it to do that?You have to do that manually, like this: $var = FileSaveDialog( "Choose a name." & ".txt", $MyDocsFolder, "blah (*.txt)", 2) If StringRight($var,4)<>".txt" Then $var&=".txt" FileWrite($var, $var2 & $var3) Broken link? PM me and I'll send you the file!
acana007 Posted May 11, 2008 Author Posted May 11, 2008 (edited) monoceres said: You have to do that manually, like this: $var = FileSaveDialog( "Choose a name." & ".txt", $MyDocsFolder, "blah (*.txt)", 2) If StringRight($var,4)<>".txt" Then $var&=".txt" FileWrite($var, $var2 & $var3) can you explain to me why this works edit never mind i understand it now but i think that it should be installed via an option in the FileSaveDialog function Edited May 11, 2008 by acana007
monoceres Posted May 11, 2008 Posted May 11, 2008 acana007 said: can you explain to me why this worksFirst I check if the user already has entered .txt, I do this by extracting the last four chars and comparing them. If they are not equal to ".txt" then I add ".txt" to the string, I do this with &= Broken link? PM me and I'll send you the file!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now