what does const TAB = ^I in pascal?
-
11-02-2021 - |
Domanda
I'm following the tutorial here. Under the heading The Cradle, you can see the code:
const TAB = ^I;
well this is a pascal code, actually I'm trying to re-implement those pascal code to Java or groovy(so that I can build a kind of compiler using Java or groovy). But what does the above coding statement meant in pascal?
How I can represent it in Java or Groovy?
Thanks in advance.
Soluzione
The ^I
is simply a short-hand for Control+I
, which is a representation of ASCII tab character (code 9). On old terminals, pressing (and holding) the control key while pressing a character produced the characters from the ASCII control character range (e.g., Ctrl+A = ASCII 1, ..., Ctrl+M = ASCII 13 = Newline, etc.)
In Groovy, you should probably use final char Tab = '\t'
Altri suggerimenti
In Groovy 1.8.4, I settled on simply:
def Tab = '\t'
as this kept giving errors:
final char Tab = '\t'