Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21843

Putting Chr(n) values in a Textbox

$
0
0
Code:

Private Sub Command4_Click()
 Dim a() As String
 Dim CC As String
 Dim C As Integer
 Dim B As String

 a = Split(Text3.Text, ",")
 
 CC = ""
 
 txtYourString.Text = ""
 
 For n = 0 To UBound(a)
  c = CInt(a(n))
  B = Chr(c)
  CC = CC & B
  txtYourString.Text = txtYourString.Text & B
 Next n
End Sub

Using the above code I put "40, 255, 255, 255, 40, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255" in Text3. When I click on Command4 the code puts (ÿÿÿ(ÿÿÿÿÿÿÿÿÿÿ in CC and txtYourString. This is correct.

Now if I put "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0" in Text3 and click on Command4 I get nothing, i.e. I get "" in txtYourString but I do get a series of small square boxes in variable CC

So my question is why am I able to translate the 1st string ("40, 255, 255, ....255") and get the correct Chr() results in txtYourString but I am not able to get the correct results when I enter the 2nd string in txtYourString but it does appear to be correct in variable CC

Viewing all articles
Browse latest Browse all 21843

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>