Jump to content

Search the Community

Showing results for tags 'concatenation'.

  • 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

Categories

  • Forum FAQ
  • AutoIt

Calendars

  • Community Calendar

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, I get an error when trying to build a multiline concatenated string with comments inbetween. I think it's more like a minor bug than a real problem, but since I saw bug report forums are closed/archived and I don't know if it's a kown thing or not, I'm gonna post it here to be sure if this needs to be reported as a bug or it's not. This example I made for this purpose works: #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> Global $Form1 = GUICreate("Test", 150, 168, 392, 362) Global $Input1 = GUICtrlCreateInput("1", 3, 10, 130, 21) Global $Input2 = GUICtrlCreateInput("11", 3, 43, 130, 21) Global $Input3 = GUICtrlCreateInput("123", 4, 76, 130, 21) Global $Input4 = GUICtrlCreateInput("1234", 4, 108, 130, 21) Global $BtnTest = GUICtrlCreateButton("Test", 3, 136, 130, 25) GUISetState(@SW_SHOW) $TestString = "Test values: " & _ GUICtrlRead($Input1) & "," & _ GUICtrlRead($Input2) & "," & _ GUICtrlRead($Input3) & "," & _ GUICtrlRead($Input4) While 1 Local $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $BtnTest MsgBox(0,"test",$TestString) EndSwitch WEnd But this throws errors during compilation: #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> Global $Form1 = GUICreate("Test", 150, 168, 392, 362) Global $Input1 = GUICtrlCreateInput("1", 3, 10, 130, 21) Global $Input2 = GUICtrlCreateInput("11", 3, 43, 130, 21) Global $Input3 = GUICtrlCreateInput("123", 4, 76, 130, 21) Global $Input4 = GUICtrlCreateInput("1234", 4, 108, 130, 21) Global $BtnTest = GUICtrlCreateButton("Test", 3, 136, 130, 25) GUISetState(@SW_SHOW) $TestString = "Test values: " & _ GUICtrlRead($Input1) & "," & _ GUICtrlRead($Input2) & "," & _ ;Crash my building here pls! GUICtrlRead($Input3) & "," & _ GUICtrlRead($Input4) While 1 Local $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $BtnTest MsgBox(0,"test",$TestString) EndSwitch WEnd Did one more test and found that this is true also for code and not only for string concatenations. The code gets evaluated as actual code even if it's a comment. Look at the If statement: This works: #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> Global $Form1 = GUICreate("Test", 150, 168, 392, 362) Global $Input1 = GUICtrlCreateInput("1", 3, 10, 130, 21) Global $Input2 = GUICtrlCreateInput("11", 3, 43, 130, 21) Global $Input3 = GUICtrlCreateInput("123", 4, 76, 130, 21) Global $Input4 = GUICtrlCreateInput("1234", 4, 108, 130, 21) Global $BtnTest = GUICtrlCreateButton("Test", 3, 136, 130, 25) GUISetState(@SW_SHOW) Global $ShowMessage = True While 1 Local $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $BtnTest $TestString = "Test values: " & _ GUICtrlRead($Input1) & "," & _ GUICtrlRead($Input2) & "," & _ GUICtrlRead($Input3) & "," & _ GUICtrlRead($Input4) If (StringLen($TestString) > 25 And _ $ShowMessage) Then MsgBox(0, "test", $TestString) Else MsgBox(0, "test", "Oh noes!") EndIf EndSwitch WEnd And this won't: #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> Global $Form1 = GUICreate("Test", 150, 168, 392, 362) Global $Input1 = GUICtrlCreateInput("1", 3, 10, 130, 21) Global $Input2 = GUICtrlCreateInput("11", 3, 43, 130, 21) Global $Input3 = GUICtrlCreateInput("123", 4, 76, 130, 21) Global $Input4 = GUICtrlCreateInput("1234", 4, 108, 130, 21) Global $BtnTest = GUICtrlCreateButton("Test", 3, 136, 130, 25) GUISetState(@SW_SHOW) Global $ShowMessage = True While 1 Local $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $BtnTest $TestString = "Test values: " & _ GUICtrlRead($Input1) & "," & _ GUICtrlRead($Input2) & "," & _ GUICtrlRead($Input3) & "," & _ GUICtrlRead($Input4) If (StringLen($TestString) > 25 And _ ;Crash me plz! $ShowMessage) Then MsgBox(0, "test", $TestString) Else MsgBox(0, "test", "Oh noes!") EndIf EndSwitch WEnd
×
×
  • Create New...