Bin()

语法

Result$ = Bin(Value.q [, Type])
概要
Converts a quad numeric number into a string, in binary format.

参数

Value.q The number to convert.
Type (optional) If the value should be handled as another type, one of the following value can be specified:
  #PB_Byte   : The value is handled as a byte number, ranging from 0 to 255
  #PB_Ascii  : The value is handled as a ascii character, ranging from 0 to 255
  #PB_Word   : The value is handled as a word number, ranging from 0 to 65535
  #PB_Unicode: The value is handled as a unicode character, ranging from 0 to 65535
  #PB_Long   : The value is handled as a long number, ranging from 0 to 4294967296
  #PB_Quad   : The value is handled as a quad number, ranging from 0 to 18446744073709551615

返回值

A string holding the binary representation of the specified value.

示例

  Debug Bin(32) ; Will display "100000"
  Debug Bin(1024*1024*1024*1024) ; Will display "10000000000000000000000000000000000000000"

Remarks

If leading zero are needed in the output string, use the RSet() function as follows:
  Debug RSet(Bin(32), 16, "0") ; Will display "0000000000100000"

参阅

Str(), Val() and Hex().

已支持操作系统

所有

<- Asc() - String Index - Chr() ->