Jump to content

Search the Community

Showing results for tags 'multiline'.

  • 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 2 results

  1. i have a script that let you type text then give a random result on an output box, writes the result on a text file and tries to add the result text to an edit box but doesn't support multiple lines. I want the script to add lines of results on the edit box (as a log of results) #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <StaticConstants.au3> #include <File.au3> #include <Date.au3> Global $result1s[3]=["one", "two", "three"] _Main() Func _Main() Local $button1 Local $output, $die, $msg, $results1 Local $file = FileOpen("test.txt", 1) Local $g_idEdit GUICreate("test", 600, 400, -1, -1) $button1 = GUICtrlCreateButton("Result", 432, 350, 80, 40) $sText = $results1 $edit = GUICtrlCreateEdit($sText & @CRLF & $sText & @CRLF & $sText, 60, 50, 450, 300, BitOr($GUI_SS_DEFAULT_EDIT, $ES_READONLY)) $output1 = GUICtrlCreateInput("", 60, 30, 450, 20, BitOR($ES_CENTER, $ES_READONLY)) $g_idEdit = GUICtrlCreateEdit("", 60, 10, 450, 20, $SS_LEFT) $die = GUICtrlCreateLabel("", 700, 500, 700, 20, $SS_SUNKEN) GUICtrlSetFont($output, 8, 800, "", "Verdana") GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $button1 $results1 = Random(1, 2, 1) GUICtrlSetData($output1, $result1s[$results1]) GUICtrlSetData($edit, $result1s[$results1]) $read1 = GUICtrlRead($output1) FileWriteLine($file, _NowDate()& " " & _nowTime() & " " &GUICtrlRead($g_idEdit)) FileWriteLine($file, _NowDate()& " " & _nowTime() & " " &$read1) EndSelect If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>_Main
  2. 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...