开发者

RealBasic byte to string

In RealBasic, is there a way to convert 开发者_运维技巧a byte to a string?


If you mean turn a Byte into a string representation of the byte in Binary (or hex or Octal), then:

  Dim x As Byte = 24  //For example
  Dim z, y, w As String
  y = Bin(x)      //Binary = "11000"
  z = Hex(x)      //Hexadecimal = "18"
  w = Oct(x)      //Octal = "30"


You could use MemoryBlock:

  Dim m As MemoryBlock
  m = NewMemoryBlock(1)
  m.Byte(0) = 65
  MsgBox(m.StringValue(0, 1)) // Displays "A"

Of course, Chr(65) does the same thing...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜