badapple89 Posted June 13, 2013 Share Posted June 13, 2013 (edited) So I have read a few posts and tried different things but I cant get this working. I have a GUI with a GUICtrlCreateEdit box so I can type in multiple lines. I then want to write all these lines to a html file (as separate lines but all together in one block. The whole script is pretty big, but but these are the bits of code im using. $GUIExtraInfo = GUICtrlCreateEdit("", 10, 65, 250, 80) $vExtraInfo = GUICtrlRead($GUIExtraInfo) If $vExtraInfo > "" Then FileWriteLine($Signature, "<span class=" & ">" & $vExtraInfo & "</span><br />") It all works - and when I use a msg box to read $vExtraInfo I get the text entered as two lines. But when writing to the file it all comes out on the one line. I have tried stringsplit and a few other things but dosent seem to work. Help appreciated Brain wave. Do I a FileWriteLine(........) for each line entered into the GUICtrlCreateEdit???? Not sure how I would implement this. Edited June 13, 2013 by badapple89 Link to comment Share on other sites More sharing options...
PlayHD Posted June 13, 2013 Share Posted June 13, 2013 #include <GuiEdit.au3> _GUICtrlEdit_GetLine($hWnd, $iLine) My UDF : _WinShake, _WinSplitMy Apps : Google Guitar Bot, PuzzleGameDesign Gui : Interesting Tabs Design, RBox Project (abandoned), Animated Gui on Exit Link to comment Share on other sites More sharing options...
FireFox Posted June 13, 2013 Share Posted June 13, 2013 I then want to write all these lines to a html file (as separate lines but all together in one block. What do you mean by all together in one block ? Directly write the whole edit content into a file would exactly do the same thing. Br, FireFox. Link to comment Share on other sites More sharing options...
badapple89 Posted June 14, 2013 Author Share Posted June 14, 2013 Firefox I mean when my gui runs and I type This is line one This is line two into the GUICtrlCreateEdit box That it writes into the html file exactly the same, eg This is line one This is line two That is to say I don't actually need to break up the lines and use them in different parts later on. PlayHD, I had a quick look at that function not sure I understand how it works but I will play around with it monday. Am I even using GUICtrlCreateEdit in the correct way? All I need is a multiple line input box for GUI and to write thoes lines back to a file. Link to comment Share on other sites More sharing options...
FireFox Posted June 14, 2013 Share Posted June 14, 2013 If you don't need to have the line breaks, then make a StringReplace. $s1 = "This is line one" & @CrLf & "This is line two" $s2 = StringReplace($s1, @CrLf, "") ;this var will be written to the file ConsoleWrite($s2 & @CrLf) Br, FireFox. Link to comment Share on other sites More sharing options...
badapple89 Posted June 17, 2013 Author Share Posted June 17, 2013 Thanks for the help but used Play's suggestion. $linecountExtraInfo = _GUICtrlEdit_GetLineCount ($GUIExtraInfo) ;If extrainfo has lines If $linecountExtraInfo <= 0 Then ;For each line For $i = 0 to $linecountExtraInfo -1 ;Write the line to signature FileWriteLine($Signature, "<span class=" & ">" & _GUICtrlEdit_GetLine($GUIExtraInfo, $i) & "</span><br />") Next Endif Cheers for the help though guys! Link to comment Share on other sites More sharing options...
FireFox Posted June 17, 2013 Share Posted June 17, 2013 It seems like you described very well what you wanted to do *ironic* Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now