Guest 9thcircle Posted February 21, 2007 Report Share Posted February 21, 2007 Ok heres what Ive got right now Ive tried my loop a bunch of different ways but I cant this to work!rp1 = UCase(Text2.Text)rp2 = UCase(Text3.Text)Dim lngResult As LongDim lngStart As LongDim EOF As LongstrFind = rp1EOF = Len(crypt)MStop = EOFlngStart = 1Do While MStop > 0lngResult = InStr(lngStart, crypt, rp1, 1)lngStart = lngResultMid(decrypt, lngStart, 1) = rp2'decrypt = Replace(decrypt, rp1, rp2, lngStart, 1)MStop = MStop - 1LoopWhat im going for is to read from a string to find a variable charecter and replacing that charecter in another string with another variable charecter, then start from that charecter and find the next instance to replace that one and continue to the end of the string.It works, sort of...it replaces the first instance and only the first instance, sometimes, depending on how i try to do my loop it only seems to change the first charecter... well if anyone can help it would be much apreciated... Thank you! Quote Link to post Share on other sites
MrAdam 0 Posted February 23, 2007 Report Share Posted February 23, 2007 Mid(decrypt, lngStart, 1) = rp2'decrypt = Replace(decrypt, rp1, rp2, lngStart, 1) in Mid() you're saying the string to check through is "decrypt", yet decrypt is set after that statement, and it's "rem'd" out?oh and i think Mid() needs to be on the other side of the equals sign?----------Adam Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.