Jump to content

Search the Community

Showing results for tags 'code error'.

  • 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. Hi all, I am trying to make simple function to help coding in SciTE editor. This function will automatically add an "EndIf / EndFunc / WEnd / Next / EndSwitch / EndSelect / Until " after we press the enter key. It checks for first word of that line. And if the first word is " If / Func / While / For / Switch / Select / Do" , then it will work. Otherwise a normal enter key will work. Please look at my code. Unfortunately, this is not working. Please help me to find the error. #include <StringConstants.au3> #include <Array.au3> HotKeySet("{ENTER}", "AutoFiller") HotKeySet("!{ESC}", "Exiter") While 1 Sleep(10) WEnd Func AutoFiller() Local $title = WinGetTitle("[CLASS:SciTEWindow]") ; getting title of SciTE window Local $text = ControlGetText($title, "S", 350) ; getting text from code editor Local $col = ControlGetText($title, "", 353) ; getting text from status bar Local $Get_Digit_from_col = StringRegExp($col, "\d{1,4}", 3) ; an array and put line number and col number Local $Line_number = $Get_Digit_from_col[0] ; this is line number where cursor residing Local $Col_number = $Get_Digit_from_col[1] ; this is col number where cursor residing Local $CodeLines_Array = StringSplit($text, @CR) ; splitting code window text as lines Local $Last_lineText = $CodeLines_Array[$Line_number] ; this is text where cursor residing Local $TempArray = StringSplit($Last_lineText, " ") ; splitting the text into words Local $Start_text = $TempArray[1] ; this is the first word in that line Local $End_text = $TempArray[$TempArray[0]] ; this is the last word in that line If $Start_text = "If" And $End_text = "Then" Then ControlSend($title, "S", 350, "{ENTER}{BACKSPACE}{ENTER}EndIf{ESC}{UP}{TAB}") ElseIf $Start_text = "If" And $End_text <> "Then" Then ControlSend($title, "S", 350, " Then {ENTER}{BACKSPACE}{ENTER}EndIf{ESC}{UP}{TAB}") ElseIf $Start_text = "Func" Then ControlSend($title, "S", 350, "{ENTER}{BACKSPACE}{ENTER}EndFunc{ESC}{UP}{TAB}") ElseIf $Start_text = "While" Then ControlSend($title, "S", 350, "{ENTER}{BACKSPACE}{ENTER}WEnd{ESC}{UP}{TAB}") ElseIf $Start_text = "For" Then ControlSend($title, "S", 350, "{ENTER}{BACKSPACE}{ENTER}Next{ESC}{UP}{TAB}") ElseIf $Start_text = "Do" Then ControlSend($title, "S", 350, "{ENTER}{BACKSPACE}{ENTER}Untill{ESC}{UP}{TAB}") ElseIf $Start_text = "Switch" Then ControlSend($title, "S", 350, "{ENTER}Case {ENTER} {BACKSPACE}EndSwitch{ESC}{UP}{END}") ElseIf $Start_text = "Select" Then ControlSend($title, "S", 350, "{ENTER}Case {ENTER} {BACKSPACE}EndSelect{ESC}{UP}{END}") Else ControlSend($title, "S", 350, "{ENTER}") EndIf EndFunc ;==>AutoFiller Func Exiter() Exit EndFunc ;==>Exiter
×
×
  • Create New...