Q1: What does this mean: WriteLn (#$0b) ?
WriteLn (#$0b)
$0b should be hexadecimal, like 0x0b , but what about the # sign?
$0b
0x0b
#
2:
x:=readkey; if ( x = #5) do...
Does #5 mean five? Then what is the # sign for?
#5
Many thanks.
# before the number represents the character with the specified value (both decimal and hexadecimal numbers preceded by the $ character). So #5 same as chr(5) or Ctrl E.
$
chr(5)
Ah, memories ...
#x really equivalent to chr(x) , for example, Greg Hugill .
#x
chr(x)
I want to add some information.Extended keys, i.e. arrow keys, send zero and char code:
ch := ReadKey; if ch = #0 then begin // extended key ch := ReadKey; // <-- read again to get the actual code end else ...