Mikroelektronika MIKROE-350 Fiche De Données

Page de 526
WHITESPACE
Whitespace is a collective name given to spaces (blanks), horizontal and vertical
tabs, and comments. Whitespace serves to indicate where tokens start and end, but
beyond this function, any surplus whitespace is discarded.
For example, the two sequences
dim tmp as byte
dim as word
and
dim
tmp  
as  byte
dim
j  
as  word
are lexically equivalent and parse identically.
Newline Character
Newline character (CR/LF) is not a whitespace in BASIC, and serves as a statement
terminator/separator. In mikroBasic PRO for AVR, however, you may use newline to
break long statements into several lines. Parser will first try to get the longest pos-
sible expression (across lines if necessary), and then check for statement termina-
tors.
Whitespace in Strings
The ASCII characters representing whitespace can occur within string literals, where
they are protected from the normal parsing process (they remain as a part of the
string). For example, statement
some_string = "mikro foo"
parses to four tokens, including a single string literal token:
some_string
=
"mikro foo"
newline character
112
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Language Reference
mikroBasic PRO for AVR
CHAPTER 5