MrVietA2 Posted October 29, 2011 Share Posted October 29, 2011 (edited) Hi everyone !I found guinness's UDF and I have 1 questions for this script :#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <GUIConstantsEx.au3> _Main() Func _Main() Local $sFilePathURL = "http://ftp.opera.com/pub/opera/win/1152/en/Opera_1152_en_Setup.exe" Local $hGUI, $iButton, $iLabel, $iProgressBar, $sFilePath $hGUI = GUICreate("_InetGetGUI()", 370, 90, -1, -1) $iLabel = GUICtrlCreateLabel("Welcome to the simple Downloader!", 5, 5, 270, 40) $iButton = GUICtrlCreateButton("&Download", 275, 2.5, 90, 25) $iProgressBar = GUICtrlCreateProgress(5, 60, 360, 20) GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $iButton $sFilePath = _InetGetGUI($sFilePathURL, $iLabel, $iProgressBar, $iButton, @ScriptDir) If @error Then Switch @extended ; Check what the actual error was by using the @extended command. Case 0 MsgBox(64, "Error", "Check the URL or your Internet Connection!") Case 1 MsgBox(64, "Fail", "Seems the download was canecelled, but the file was >> " & $sFilePath) EndSwitch Else ;What is condition behind the word "Else" ? MsgBox(64, "Success", "Downloaded >> " & $sFilePath) EndIf EndSwitch WEnd EndFunc ;==>_Main In that script, "Else" become "ElseIf" and have 1 condition behind . What is condition behind the word "Else" ?Please show me !Thanks Edited October 29, 2011 by MrVietA2 Link to comment Share on other sites More sharing options...
bogQ Posted October 29, 2011 Share Posted October 29, 2011 (edited) its nothing Else mean everything else that you did not put in IF or ElseIf so that condition need to be empty If you have $a = 5 If $a >= 6 Or $a <= 4 Then MsgBox(0,'','1') Else MsgBox(0,'','2') EndIf Else will trigger when $a = 5, that is when If and Elseif arn`t triggered Similar explanation is for "Case Else" Edited October 29, 2011 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
MrVietA2 Posted October 29, 2011 Author Share Posted October 29, 2011 (edited) No, I would like to know the True condition, "Else" mean everything but I want know what exactly condition if successful download, because something wrong will mean "Else" and I saw it in my script Edited October 29, 2011 by MrVietA2 Link to comment Share on other sites More sharing options...
bogQ Posted October 29, 2011 Share Posted October 29, 2011 Cant you read that one from function Udf?; Name...........: _InetGetGUI(); Return values .: Success - Downloaded filename.; Failure - Returns downloaded filename & sets @error = 1 (@extended = 0 if internal error or @extended = 1 if cancelled was selected.)or i still dont understand you MrVietA2 1 TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
MrVietA2 Posted October 29, 2011 Author Share Posted October 29, 2011 (edited) I understand it now, thanks bogQ ! Edited October 29, 2011 by MrVietA2 Link to comment Share on other sites More sharing options...
guinness Posted October 29, 2011 Share Posted October 29, 2011 (edited) Thanks bogQ. Edit: Nothing more to add I think bogQ 'hit the nail on the head.' Apart from MrVietA2 why did you create another thread when you already had an open thread running? Edited October 29, 2011 by guinness UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 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