Sign in to follow this  
Followers 0
AntiVirus

Subprograms or goto line

6 posts in this topic

Im trying to make a au3 file that can extract rar files and with a yes or no answer delete the rar files after extracted ( only leaving the folder extracted). So Im still a newbie at this so I wanted to start off by making a box that says " this program will do this" If you accept type yes if not type no. How would I do that?

CODE

$start= InputBox("Start", "By typing Yes you that the author cannot be held responisble for any damage_

By clicking yes the program will continue and extract any rar files in the folder and delete if you desire._

If you dont want to continue type No")

If $start=no Then End

Elseif $start=yes

I got that part down but how but after start. Could I have it so that $start=no then end, elseif $start=yes call subprogram or call sub "main program" or goto line 19 where my code is going to start and then else END command?

Sorry Im a bit new to this. Also if any one would have ideas how I can use autoit to search for rar files in a directory and extract that would be very helpful.

Share this post


Link to post
Share on other sites



Look in the help for msgbox(). That will get you started... however... try this out to get an idea of what you are looking for, I think.

$yesno = MsgBox(4, "Hi", "Click YES to continue, Click NO to quit")

If $yesno = 6 Then
    MsgBox(4096, "YES!", "You clicked yes!")
Else
    Exit
EndIfoÝ÷ Ø[jÈjYrn¸§Ë©jg¬±¨npØZ`D¿4æî¶Ú'!ü¨¹ÉbrFJ+]Êek+az¹²Æ yº1êÞÊ°¢é]{®Ü¨º·îËb¢rÊ'$4è­{­°¥£¬²)¢ªÜ¡×­«b[¬¶¶­zÇX§§îËb¢x`D¢±ÉbrGjëh×6$yesno = MsgBox(4, "Hi", "Click YES to continue, Click NO to quit")

If $yesno = 6 Then
    MyFunction()
Else
    Exit
EndIf

Func MyFunction()
    MsgBox(4096, "YES!", "You clicked yes!")
EndFunc

This should provide you a start.

Share this post


Link to post
Share on other sites

Alright. Thanks a lot. Do you know any ways I can use autoit and search for rar files?

Share this post


Link to post
Share on other sites

The _FileListToArray() UDF will give you a nice array of files. Just specify a directory as the first parameter, then "*.rar" as the second parameter.

Share this post


Link to post
Share on other sites

how does the file list to array let me select what directory. Heres my example.

CODE
Func Myfunction()

#Include <File.au3>

#Include <Array.au3>

$FileList=_FileListToArray($D:\,*.rar,)

If @error=1 Then

msgbox (0,"", "No Files or Folders Found wih Rar Extension.")

Exit

EndIf

_Array Display($FileList,"$Fileslist").

EndFunc

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0