Jump to content

Subprograms or goto line


AntiVirus
 Share

Recommended Posts

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.

Link to comment
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.

Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...