Intrinsic-26 HexIn

Top  Previous  Next

26: variable:= HexIn(device);

 

This intrinsic gets a hex integer from the specified input device. Hex values should be in the range: $0000_0000 through $FFFF_FFFF. For example:

 

  X:= HexIn(0);           \Get hex value from keyboard buffer

 

This intrinsic skips any non-hex characters until a hex character is found, thus the dollar sign is optional. Hex numbers are unsigned, and any minus sign is ignored. Any underlines in the hex number are also ignored. Hex digits are read until a non-hex character (or control-Z) is found, thus numbers are terminated by a non-hex character, such as a carriage return. This intrinsic also returns after reading eight hex digits, which enables continuous sequences of hex digits to be read 32-bits at a time.