atomman Posted January 14, 2008 Share Posted January 14, 2008 why doesn't this work? it doesn't replace the linefeeds/returns with ".". saw another example here that does exactly the same thing, and it works. also tried StringRegExpReplace() with "\n". If StringInStr($str, @CRLF) Then StringReplace($str, @CRLF, ".")oÝ÷ Ù©e¡øjëh×6$str = FileRead(@ScriptDir & "\test.txt") MsgBox(0,"string is...",$str) If StringInStr($str, @CRLF) Then MsgBox(0,"does it have returns?","ya") StringReplace($str, @CRLF, ".") MsgBox(0,"error in StringReplace?",@error) EndIf MsgBox(0,"new string",$str) Link to comment Share on other sites More sharing options...
martin Posted January 14, 2008 Share Posted January 14, 2008 why doesn't this work? it doesn't replace the linefeeds/returns with ".". saw another example here that does exactly the same thing, and it works. also tried StringRegExpReplace() with "\n". StringInStr doesn't change the variable passed to it, it returns the altered string. So you need If StringInStr($str, @CRLF) Then $str = StringReplace($str, @CRLF, ".") endif Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
atomman Posted January 14, 2008 Author Share Posted January 14, 2008 oh jeez! i better lock myself in a closet. thanks martin! Link to comment Share on other sites More sharing options...
martin Posted January 14, 2008 Share Posted January 14, 2008 oh jeez!i better lock myself in a closet. thanks martin!NP.Don't worry about a mistake like that, the name suggests that it's going to do what you thought. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. 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