Oppolzer - Informatik / Stanford Pascal Compiler


Home       Lebenslauf       Schwerpunkte       Kenntnisse       Seminare       Kunden       Projekte       Produkte       Blog       Stanford Pascal       Kontakt

The Stanford Pascal Compiler / Evolution Steps

Back to Compiler main page

String constants built from several mixed parts (hex or binary)

Compiler version: 10.2017

String constants may be concatenated simply by appending them one after the other, seperated by blanks. The maximum length may not exceed 254 at the moment.

With older releases of the compiler, it was not possible to mix normal, hex and binary representations in such concatenations. And the length limit was not computed correctly with hex string constants.

When migrating to the new (external) scanner PASSCAN, these problems could be solved.

Definitions like the following are now possible:


const S_ESC = X'1b' ; S_LF = X'0a' ; S_CR = X'0d' ; S_VS_0 = X'0d' ; S_VS_1 = X'1b' '&l12D' X'0d0a' ; S_VS_2 = X'1b' '&l6D' X'0d0a' ; S_VS_3 = X'1b' '&l4D' X'0d0a' ; S_VS_4 = X'1b' '&l3D' X'0d0a' ; S_SCHATTEIN = X'1b' '(s3B' ; S_SCHATTAUS = X'1b' '(s0B' ; S_CPI10 = X'1b' '(s10H' ; S_CPI12 = X'1b' '(s13H' ; S_TRANSP = X'1b' '&p1X' ; S_C24 = X'1b' '&p1X' X'18' ; S_C25 = X'1b' '&p1X' X'19' ; S_CPI10VS2 = X'1b' '&l6D' X'0d0a' ; S_CPI12VS2 = X'1b' '&l6C' X'0d0a' ;

You may have noticed that these constants are printer control sequences for a HP printer (PCL = printer control language). I translated a very old BASIC program (from the 1980s) into Pascal, which performed simple layout services on text documents, and while doing this, the need for such constant definitions came up.

Back to Compiler main page