A simple modification can be done to link "normal" characters so that simple text can be shown together rather than every individual character. This will make it easier to look along a long text containing a lot of "normal" text, such as words and numbers
A simple text string can be added if the current and last character was something "normal" at code sectionAny text can be used, but it should be chosen to be something unlikely to occur as text in your original string, strInCode:If Caracter Like "[A-Z]" Or Caracter Like "[0-9]" Or Caracter Like "[a-z]" Then ' Check for normal characters 'SirNirios If Not Cnt = 1 Then ' I am only intersted in next line comparing the character before, and if i did not do this the next line would error if first character was a "normal" character If Not Cnt = myLenf And (Mid(strIn, Cnt - 1, 1) Like "[A-Z]" Or Mid(strIn, Cnt - 1, 1) Like "[0-9]" Or Mid(strIn, Cnt - 1, 1) Like "[a-z]") Then ' And (Mid(strIn, Cnt + 1, 1) Like "[A-Z]" Or Mid(strIn, Cnt + 1, 1) Like "[0-9]" Or Mid(strIn, Cnt + 1, 1) Like "[a-z]") Then Let WotchaGot = WotchaGot & "|LinkTwoNormals|" Else End If Else End If Let WotchaGot = WotchaGot & """" & Caracter & """" & " & " ' This will give the sort of output that I need to write in a code line, so for example if I have a123 , this code line will be used 4 times and give like a final string for me to copy of "a" & "1" & "2" & "3" & I would phsically need to write in code like strVar = "a" & "1" & "2" & "3" - i could of course also write = "a123" but the point of this routine is to help me pick out each individual element Else ' Some other things that I would like to "see" normally - not "normal simple character" - or by a VBA constant, like vbCr vbLf vbTab
For a test code of like this …__.. the seen text in the message box or Immediate window would beCode:Sub TestWtchaGot() ' In the practice we would likely have our string obtained from some method and would have it held in some string variable Dim strTest As [color=blue]String[/color Let strTest = Chr(1) & "High""er" & vbCrLf & vbTab & """u.""" Call WtchaGot(strIn:=strTest) End Sub
Chr(1) & "H" & |LinkTwoNormals|"i" & |LinkTwoNormals|"g" & |LinkTwoNormals|"h" & """" & "e" & |LinkTwoNormals|"r" & vbCr & vbLf & vbTab & """" & "u" & "." & """"
Further down in the coding, the occurrences of " & |LinkTwoNormals|" can be removed with a simple line like
The output will then be likeCode:Let WotchaGot = Replace(WotchaGot, """ & |LinkTwoNormals|""", "", 1, -1, vbBinaryCompare)
Chr(1) & "High" & """" & "er" & vbCr & vbLf & vbTab & """" & "u" & "." & """"
Full modified coding including Calling routine for testing in the next post




Reply With Quote
Bookmarks