CodyBarrett Posted April 9, 2009 Share Posted April 9, 2009 (edited) i have a chatroom.. that runns off of a shared drive, there is one file that every one reads from.. an example is LANCR in my sig.. but im working on a new one AIOCR which is also in my sig.. and im working on PMs and i need to find the line... assign it to a $var.. and then rewrite the txt without the PM in it... here is what i have here is an example of a PM *ToClient_Message_FromClient^ If StringInStr ($File, @CRLF & '*' & @UserName) Or StringInStr ($File, @CRLF & '*' & $Name_S) Then Dim $FileA, $i, $pm _FileReadToArray ($S_TXT, $FileA) For $i=1 To $FileA[0] $FileA[$i]=_HexToString ($FileA[$i]) _ArrayDisplay ($FileA[$i]) If StringInStr ($FileA[$i], @CRLF & '*' & @UserName) Or StringInStr ($FileA[$i], @CRLF & '*' & $Name_S) Then $pm=_Stringbetween ($FileA[$i], '*', '^') $FileA[$i]=_StringToHex('') FileDelete ($S_TXT) FileWrite ($S_TXT, '') _FileWriteFromArray ($S_TXT, $FileA[0]) EndIf Next Else the TXT file is HEX... so i just use _Stringtohex(Fileread($S_TXT) to read it.. and viseversa to write.. but im having troubles with this string maniputaion.. ive searched and helpfiled it lol any ideas? Edited April 10, 2009 by CodyBarrett [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
CodyBarrett Posted April 10, 2009 Author Share Posted April 10, 2009 (edited) BUMP when i try fileread and stringreplace... or stringbetween it doest write the New filedata to the file.. EDIT alright i think i know the problem.. its writen in HEX and filereadtoarray reads the file lines.. HEX is ONE complete string no spaces.. no @CRLFs, so FILEreadtoarray doesnt seem to work. am i right? or is it something entirely different? and how would i fix this to it does it correctly? Edited April 11, 2009 by CodyBarrett [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
CodyBarrett Posted April 12, 2009 Author Share Posted April 12, 2009 ok.. ive fixed it on my own... here is the code NOW incase anyone cares lol If StringInStr ($File, @CRLF & '*' & @UserName) Or StringInStr ($File, @CRLF & '*' & $Name_S) Then Dim $pm, $string, $PerMes, $Reply, $From, $To $pm=_StringBetween ($File, '*', '^') $PerMes=$pm[0] $string=StringReplace ($File,@CRLF & '*' & $pm[0] & '^' & @CRLF, '') FileDelete ($S_TXT) FileWrite ($S_TXT, _StringToHex ($string)) $Reply=InputBox ('Personal Messenger...', $PerMes, 'Reply...', '', 400, 120, -1 ,-1 ,60 ,$SHARED_Chat_GUI) If @error Then Else FileWrite ($S_TXT, _StringToHex ( @CRLF & '*' & $Reply & ' : From ' & $Name_S & '^' & @CRLF)) EndIf [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] 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