开发者

RealBasic byte to string

开发者 https://www.devze.com 2023-01-07 05:20 出处:网络
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:

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

精彩评论

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

关注公众号