matthieuvb Posted June 10, 2010 Share Posted June 10, 2010 (edited) How do you split the data in an edit in lines? I Try this: StringSplit(GUICtrlRead($Edit), @CRLF) But the Help says This: "Caution if you use the macro @CRLF you are referring to a 2 character string so you will generate extra blanks lines." How to split The data in lines without Creating extra strings? (i Making The Command prompt with autoit ) Tanx, Matthieuautoitscripter Edited June 10, 2010 by Matthieuautoitscripter [font=Helvetica, Arial, sans-serif][background=rgb(252, 252, 250)][/background][/font] Link to comment Share on other sites More sharing options...
Yoriz Posted June 10, 2010 Share Posted June 10, 2010 Hi, welcome to the forum. You can change the @CRLF into something else then split by what you changed it to. The following function will take two parameters , the first your text and the second the delimeter to use which defaults to "|" if no parameter is given. If you can safely know that "|" doesnt appear in your text that will be fine otherwise chose something else that you know wont be in the text. #include <Array.au3> $sText = "How do you split the data in an edit in lines?" & @CRLF & _ "I Try this: StringSplit($ReadEditCommand, @CRLF)" & @CRLF & _ "But the Help says This: ""Caution if you use the macro @CRLF you are referring to a 2 character string so you will generate extra blanks lines." & @CRLF & _ "How to split The data in lines without Creating extra strings?" & @CRLF & _ "(i Making The Command prompt with autoit :) )" & @CRLF & _ "Tanx," $aText = _StringSplitCRLF($sText) _ArrayDisplay($aText) Exit Func _StringSplitCRLF($sText, $sDelimeter = "|") Local $sTemp = StringReplace($sText, @CRLF, $sDelimeter) Return StringSplit($sTemp, $sDelimeter) EndFunc ;==>_StringSplitCRLF GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF. Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 10, 2010 Share Posted June 10, 2010 (edited) You can use an entire string (i.e. "<br>", or @CRLF) as the delimiter if you set flag = 1. See help file under StringSplit(). Edited June 10, 2010 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 10, 2010 Moderators Share Posted June 10, 2010 (edited) Matthieuautoitscripter,Welcome to the AutoIt forum. Just use the flag parameter in StringSplit to use the whole delimiter as the split: #include <Array.au3> $sText = "How do you split the data in an edit in lines?" & @CRLF & _ "I Try this: StringSplit($ReadEditCommand, @CRLF)" & @CRLF & _ "But the Help says This: ""Caution if you use the macro @CRLF you are referring to a 2 character string so you will generate extra blanks lines." & @CRLF & _ "How to split The data in lines without Creating extra strings?" & @CRLF & _ "(i Making The Command prompt with autoit :) )" & @CRLF & _ "Tanx," $aText = StringSplit($sText, @CRLF, 1) _ArrayDisplay($aText)M23Edit: We meet again, O flightless one! Edited June 10, 2010 by Melba23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
matthieuvb Posted June 12, 2010 Author Share Posted June 12, 2010 Thanks, it works well! [font=Helvetica, Arial, sans-serif][background=rgb(252, 252, 250)][/background][/font] Link to comment Share on other sites More sharing options...
answer Posted June 13, 2010 Share Posted June 13, 2010 How do you split the data in an edit in lines?I Try this: StringSplit(GUICtrlRead($Edit), @CRLF)But the Help says This: "Caution if you use the macro @CRLF you are referring to a 2 character string so you will generate extra blanks lines."How to split The data in lines without Creating extra strings?(i Making The Command prompt with autoit )Tanx,MatthieuautoitscripterMatthieuautoitscripter,Can i see your script?I would like to know what you're doing!I think you're good at AutoIt, so i realy want to see your script!Thanks! Link to comment Share on other sites More sharing options...
matthieuvb Posted June 14, 2010 Author Share Posted June 14, 2010 The script was not finished, but i have screenshots.(Dutch version of CMDM.exe)Screenshot 1:Screenshot 2:The script works correct, but the commands are not finished!And i have some errors... [font=Helvetica, Arial, sans-serif][background=rgb(252, 252, 250)][/background][/font] 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