vali khandangoll
Active Member
hi
Please introduce a function for convert ASCII to Char
for example char(65) ---> A
thanks
Please introduce a function for convert ASCII to Char
for example char(65) ---> A
thanks
Dim c As Byte = 65
Log(c)
Private Sub chr(b As Byte) As Byte()
Return Array As Byte(b)
End Sub
private Sub char(b As Byte) As String
Dim a As String = Array As Byte(b)
Return a
End Sub
I do understand that a string is fundamentally held as an array (or you might even say string ) of bytes with the last byte having a value 0, but in my example if the string 'a' is just rendered into an array of bytes (my interpretation of the word 'cast') then it would be as if 'a' is just the same as array of bytes(65,0). However this doesn't appear to be exactly the case since:If you cast a byte array to 'Strings', the last byte is set to 0, so in your sub the string (as byte array) has two bytes and the log shows the internal id of the array rather then its contents.
All of this is because of the memory limitations of microprocessors, not because of B4R.
The Log function renders the Byte array of one Byte as a String of one Character.
Dim e() As Byte = Array As Byte(65,0)
Log(e)