Mikroelektronika MIKROE-742 데이터 시트
memset
strcat
strchr
strcmp
498
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL PRO for AVR
CHAPTER 6
Prototype
procedure memset(p : ^byte; character : byte; n : word);
Description
The function fills the first n words in the memory area starting at the address p
with the value of word
with the value of word
character
.
For parameter p you can use either a numerical value (literal/variable/constant)
indicating memory address or a dereferenced value of an object, for example
indicating memory address or a dereferenced value of an object, for example
@mystring or @PORTB
.
Prototype
procedure strcat(var s1, s2 : string[100]);
Description
The function appends the value of string s2 to string s1 and terminates s1 with a
null character.
null character.
Prototype
function strchr(var s : string[100]; ch : byte) : word;
Description
The function searches the string s for the first occurrence of the character ch.
The null character terminating s is not included in the search.
The null character terminating s is not included in the search.
The function returns the position (index) of the first character ch found in s; if no
matching character was found, the function returns
matching character was found, the function returns
0xFFFF
.
Prototype
function strcmp(var s1, s2 : string[100]) : short;
Description
The function lexicographically compares the contents of the strings s1 and s2
and returns a value indicating their relationship:
and returns a value indicating their relationship:
Value Meaning
< 0 s1 "less than" s2
< 0 s1 "less than" s2
= 0 s1 "equal to" s2
> 0 s1 "greater than" s2
> 0 s1 "greater than" s2
The value returned by the function is determined by the difference between the
values of the first pair of words that differ in the strings being compared.
values of the first pair of words that differ in the strings being compared.