Mikroelektronika MIKROE-742 데이터 시트

다운로드
페이지 532
strcpy
strcspn
strlen
strncat
strncmp
499
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL PRO for AVR
CHAPTER 6
Prototype
procedure strcpy(var s1, s2 : string[100]);
Description
The function copies the value of the string s2 to the string s1 and appends a null
character to the end of s1.
Prototype
function strcspn(var s1, s2 : string[100]) : word;
Description
The function searches the string s1 for any of the characters in the string s2.
The function returns the index of the first character located in s1 that matches
any character in s2. If the first character in s1 matches a character in s2, a
value of 0 is returned. If there are no matching characters in s1, the length of
the string is returned (not including the terminating null character).
Prototype
function strlen(var s : string[100]) : word;
Description
The function returns the length, in words, of the string s. The length does not
include the null terminating character.
Prototype
procedure strncat(var s1, s2 : string[100]; size : byte);
Description
The function appends at most size characters from the string s2 to the string s1
and terminates s1 with a null character. If s2 is shorter than the size characters,
s2 is copied up to and including the null terminating character.
Prototype
function strncmp(var s1, s2 : string[100]; len : byte) : short;
Description
The function lexicographically compares the first len words of the strings s1 and
s2 and returns a value indicating their relationship:
Value     Meaning
< 0       s1 "less than" s2
= 0       s1 "equal to" 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 (within
first len words).