Mikroelektronika MIKROE-350 Fiche De Données
memset
strcat
strchr
strcmp
491
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroBasic PRO for AVR
CHAPTER 6
Prototype
sub procedure memset(dim p as ^byte, dim character as byte, dim n
as word)
as word)
Description
The function fills the first n words in the memory area starting at the address
p
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
sub procedure strcat(dim byref s1, s2 as string[100])
Description
The function appends the value of string
s2
to string
s1
and terminates
s1
with
a null character.
Prototype
sub function strchr(dim byref s as string[100], dim ch as byte)
as word
as 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
sub function strcmp(dim byref s1, s2 as string[100]) as 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 "equal to" 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.
values of the first pair of words that differ in the strings being compared.