t.koridass Posted February 15, 2005 Share Posted February 15, 2005 (edited) Im new to programm with Autoit and now I have a little problem. I like to move files but befor i must check if a file in the folder exist and then i get a msgbox where someone get se massage "Sorry there is any file in the folder u like to overwrit ist" und u can choose YES / NO but how can i check what someone have chosen? If FileExists ( "C:\test\test2\*.txt") Then MsgBox (4, "Datei", "Datei schon vorhanden, soll Sie überschrieben werden?") FileMove ( "C:\test\1.txt", "C:\test\test 2", 1) EndIf Edited February 15, 2005 by t.koridass Link to comment Share on other sites More sharing options...
zeroZshadow Posted February 15, 2005 Share Posted February 15, 2005 (edited) If FileExists ( "C:\test\test2\*.txt") Then $returnmsg = MsgBox (4, "Datei", "Datei schon vorhanden, soll Sie überschrieben werden?") if $msg = 1 then FileMove ( "C:\test\1.txt", "C:\test\test 2", 1) Endif EndIf i think its 1 else it would be 0 EDIT: yep its 1 Edited February 15, 2005 by zeroZshadow *If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip... Link to comment Share on other sites More sharing options...
Domonoky Posted February 15, 2005 Share Posted February 15, 2005 Hi.. i think you must store the return value of the msgbox. and decide upon this value what to do.. like: If FileExists ( "C:\test\test2\*.txt") Then $answer=MsgBox (4, "Datei", "Datei schon vorhanden, soll Sie überschrieben werden?") if $answer=1 Then FileMove ( "C:\test\1.txt", "C:\test\test 2", 1) Endif EndIf Link to comment Share on other sites More sharing options...
t.koridass Posted February 15, 2005 Author Share Posted February 15, 2005 and how u call that $answer i dont find it in the help but i think that is what i search thx Link to comment Share on other sites More sharing options...
Blue_Drache Posted February 15, 2005 Share Posted February 15, 2005 (edited) @zeroZshadow: Are you related to Dalarn? All you seem to do is like to flame. There are differences in time and when the message gets posted. You two may have been writing a reply at the same time. Yours was posted at 08:53, Domonkey posted 08:54. Frankly, your reply was only more confusing and not at all helpful when taken from a newbie's point of view as you included edited code without explaining it. Do yourself a favor, and drop the 12 year old mentality on these fourms. Thanks.and how u call that $answer i dont find it in the help but i think that is what i search thx<{POST_SNAPBACK}>@t.koridassAll you're telling autoit to do is store the results of the msgbox in a variable. Anything that begins with a $ is a variable. Calling the msgbox function without a container to store the answers will not accomplish much, if anything at all. Edited February 15, 2005 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
MHz Posted February 15, 2005 Share Posted February 15, 2005 Calling the msgbox function without a container to store the answers will not accomplish much, if anything at all.Another option, but without the container (variable).if MsgBox(4, '', 'Hello World') = 6 Then MsgBox(0, '', 'You pressed Yes') EndIfYes = 6No = 7 Link to comment Share on other sites More sharing options...
zeroZshadow Posted February 15, 2005 Share Posted February 15, 2005 oke oke i'll try to calm down. i'm allot nicer in dutch, because i just don't know how to write nice in english so SORRY, i deleted the post and already apoligize in the other topics. *If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip... Link to comment Share on other sites More sharing options...
Blue_Drache Posted February 15, 2005 Share Posted February 15, 2005 (edited) Another option, but without the container (variable).if MsgBox(4, '', 'Hello World') = 6 Then MsgBox(0, '', 'You pressed Yes') EndIfYes = 6No = 7Well, yes, there is that, but storing in a variable makes using Select/Case or If/ElseIf/EndIf much easier for the 3 button boxes. oke oke i'll try to calm down. i'm allot nicer in dutch, because i just don't know how to write nice in english so SORRY, i deleted the post and already apoligize in the other topics.<{POST_SNAPBACK}>Apology accepted....I did not realize that English was not your primary language, but some of the return replies seemed rather snappish. I guess it's just difficult to understand emotion very well over a text medium. Edited February 15, 2005 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
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