(**** value is the decimal number of converted, count is the number of binary bit output, default 32-bit ****) Function INTTOBIN (value: integer; count: integer = 32): String; var Itemp: integer; Begin Result: = ''; While Count> 0 Do Begin Itemp: = Value Shr (Count-1) and 1; Case Itemp of 1: Result: = Result '1'; 0: Result: = Result '0'; end DEC (count); end; end; written by himself, I don't know if there is a hole, test showMessage (Intetobin (-1, 8)); // Output 11111111ShowMessage (INTTOBIN (333333)); // Output 0000000000000001010101011000000000000000001010101011000000000000000001010101010101010101