Jump to content

Search the Community

Showing results for tags 'if then'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. $oExcel = ObjCreate("Excel.Application") $oExcel.Visible = 0 #include <MsgBoxConstants.au3> #Include <File.au3> Global $arlines WinActivate("MyApplication") ;Activate My Application Local $hWnd = WinWaitActive("MyApplication", "", 5) ;Wait for My Application for 5 seconds $oExcel.Application.WorkBooks.Open("C:\Users\Charlie\Desktop\Data.xlsx") ;Open Excel file 'Data.xlsx' local $iCell = $oExcel.Application.Cells(31,1).Value ;Read the value from cell A31 $file = @ScriptDir & "\Capture.log" If $hWnd Then For $a = 1 to $iCell ;STEP 1 Send("G*L") Send($oExcel.Application.Cells($a,1).Value) Send("/XUSR") Sleep(1000) Send("{ENTER}") Sleep(2000) ;===> Once the script has sent the above formats to 'MyApplication, A log file (Capture.log) is generated. What do I add as a link so the script moves to ;the following steps _FileReadToArray ($file, $arlines) For $i = $arlines [0] To 1 Step - 1 ; Script starts reading the log file from bottom up If $arlines [$i] = "‡NOT VALID" Then ;===> If I find the word '‡NOT VALID', then I want the script to go to STEP 1 in loop Else ;====> Else I want the script to do the following steps Send("MB") ; Continue sending formats to 'MyApplication' Send("{ENTER}") Sleep(2000) $iNum = StringRegExp(FileRead($file), "(?sm).*^\h*(\d{1,3})", 1)[0] ; Read number at a certain location in Capture.log file ConsoleWrite($iNum & @CRLF) EndIf ;====> Use the captured $iNum in the loop below. What do I add to proceed to the following steps For $i = 1 To $iNum Send("SET"& $i &"/USR") Sleep(500) Send("{ENTER}") Sleep(1000) ;====> Go back to STEP 1 $oExcel.Application.Quit I am a beginner and need help with If, then, else jump to specific loop in the script. Can I please get help with my script where I have multiple loops. I need to link the steps and also break the sequence and jump to specific loop if a certain condition is found in one loop.
×
×
  • Create New...