Техническая Спецификация для Mikroelektronika MIKROE-742

Скачать
Страница из 532
String Concatenating 
mikroPascal PRO for AVR allows you to concatenate strings by means of plus oper-
ator. This kind of concatenation is applicable to string variables/literals, character
variables/literals. For control characters, use the non-quoted hash sign and a
numeral (e.g. 
#13
for CR).
Here is an example:
var msg     : string[20];
res_txt : 
string[5];
res, channel : word;
begin
//...
// Get result of ADC
res := Adc_Read(channel);
// Create string out of numeric result
WordToStr(res, res_txt);
// Prepare message for output
msg := 'Result is ' +      // Text "Result is"
res_txt     ;      // Result of ADC
//...
Note: In current version plus operator for concatenating strings will accept at most
two operands.
Note
mikroPascal PRO for AVR includes a String Library which automatizes string relat-
ed tasks.
148
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Language Reference
mikroPASCAL PRO for AVR
CHAPTER 5