The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



Hex


Unit: SDL_math1
Class: None
Declaration: function Hex (innum: longint; places: byte): string;

The function Hex converts the integer number innum to an ASCII string which is the hexadecimal representation of that number. The number is written with a variable number of places, which can be defined by the parameter places (1..16). Leading zeros are not suppressed.

Hint: If the value of the parameter places is less than one or greater than eight the value is automatically restricted to these boundaries (whichever is next). If places does not suffice to display the hexadecimal representation, then the resulting string is truncated.

Example: write (Hex (2334,4)); writes the number 2334 using hexadecimal notation with 4 characters ('091E');


Last Update: 2023-Feb-06