Mikroelektronika MIKROE-742 데이터 시트

다운로드
페이지 532
mikroPascal PRO for AVR limits floating-point constants to range ±1.17549435082
* 10-38 .. ±6.80564774407 * 1038.
Here are some examples:
0.    
// = 0.0
-1.23   
// = -1.23
23.45e6  
// = 23.45 * 10^6
2e-5     
// = 2.0 * 10^-5
3E+10   
// = 3.0 * 10^10
.09E34   
// = 0.09 * 10^34
Character Literals
Character literal is one character from the extended ASCII character set, enclosed
with apostrophes.
Character literal can be assigned to variables of the byte and char type (variable of
byte will be assigned the ASCII value of the character). Also, you can assign char-
acter literal to a string variable.
Note: Quotes (
""
) have no special meaning in mikroPascal PRO for AVR.
String Literals
String literal is a sequence of characters from the extended ASCII character set,
written in one line and enclosed with apostrophes. Whitespace is preserved in string
literals, i.e. parser does not “go into” strings but treats them as single tokens.
Length of string literal is a number of characters it consists of. String is stored internal-
ly as the given sequence of characters plus a final null character. This null character
is introduced to terminate the string, it does not count against the string’s total length.
String literal with nothing in between the apostrophes (null string) is stored as a sin-
gle null character.
You can assign string literal to a string variable or to an array of char.
Here are several string literals: 
'Hello world!'          
// message, 12 chars long
'Temperature is stable' 
// message, 21 chars long
'  '                    // two spaces, 2 chars long
'C'                     // letter, 1 char long
''                      // null string, 0 chars long
The apostrophe itself cannot be a part of the string literal, i.e. there is no escape
sequence. You can use the built-in function Chr to print an apostrophe: Chr(39).
Also, see String Splicing.
124
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Language Reference
mikroPASCAL PRO for AVR
CHAPTER 5