lte5000 0 Posted September 17, 2004 In edit controls, linefeeds apparently don't appear as you would normally expect, other than when using the enter key to manually insert a linefeed.So the (only?) way to show linefeeds properly when setting an edit control with data which contains linefeeds is to ControlSend() an enter keystroke after each new line...Here's a quick script in which I used this method.expandcollapse popupGlobal $boolStarted Opt("GUICoordMode", 1) Opt("GUINotifyMode", 1) Opt("WinSearchChildren", 1) GUICreate("Current Weather", @DesktopWidth - 100, @DesktopHeight - 100) $edit_1 = GUISetControl("edit", "", 5, 5, @DesktopWidth - 150, @DesktopHeight - 150) $button_1 = GUISetControl("button", "Next", @DesktopWidth - 140, 5, 35, @DesktopHeight - 150) GUIShow() While 1 $msg = GUIMsg(0) Select Case $msg = $button_1 $iToggle = Not $iToggle If $iToggle Then GUIWrite($edit_1, "", "Ready to load WX data...") URLDownloadToFile("http://www.srh.noaa.gov/data/CTP/AFDCTP", "wx.tmp") $hfile = FileOpen("wx.tmp", 0) While 1 $szLine = FileReadLine($hfile) If @error = -1 Then ExitLoop If $szLine <> "" Then GUIWrite($edit_1, "", $szLine) ControlSend("Current Weather", "", "Edit1", "{ENTER}") Sleep(5) Wend FileClose($hfile) Else GUIWrite($edit_1, "", "Ready to load WX data...") ControlSend("Current Weather", "", "Edit1", "{ENTER}") URLDownloadToFile("http://www.accuweather.com", "wx.tmp") $hfile = FileOpen("wx.tmp", 0) While 1 Sleep(5) $szLine = FileReadLine($hfile) If Not StringInStr($szLine, "A Glimpse Inside Joe's Column...") And Not $boolStarted Then ContinueLoop $boolStarted = 1 If $boolStarted And Not StringInStr($szLine, "<b>") Then ContinueLoop If StringInStr($szLine, "A Glimpse Inside Joe's Column...") Then ContinueLoop If StringInStr($szLine, "<b>") Then $iStartPos = StringInStr($szLine, "<b>") $iEndPos = StringInStr($szLine, "</b>") EndIf $szQuote = StringMid($szLine, $iStartPos + 3, $iEndPos - $iStartPos - 3) If $szLine <> "" Then GUIWrite($edit_1, "", $szQuote) ExitLoop Wend FileClose($hfile) EndIf Case $msg = -3 Exit EndSelect Sleep(10) Wend Share this post Link to post Share on other sites
Valik 478 Posted September 17, 2004 Did you try @CRLF? That's the only thing that properly places a newline in an edit control, I believe. Share this post Link to post Share on other sites
lte5000 0 Posted September 17, 2004 Did you try @CRLF?No.That's the only thing that properly places a newline in an edit control, I believe.Yes you're right. Inserting an @CRLF is a better way than sending "Enter".Thanks.Kendall Share this post Link to post Share on other sites