User guide

51
VTB USER GUIDE
11.3 API FUNCTIONS FOR MANAGING OF STRINGS
VTB doesn't use STRING variables, to manage them there are some apposite functions similar to the “Clanguage.
STRCPY
Copies the string pointed by SOURCE into the array pointed by DEST. The string must terminate with the character 0
(NULL).
Hardware All
Syntax
STRCPY (Char *Dest, Char *Source)
Parameters
Dest Pointer to destination
Source Pointer to source
Example
Used variables:
Dest(10) char
Dest1(10) char
strcpy(Dest(),”My Text”) copy the string “My Textin dest
strcpy(Dest1(),Dest()) ‘copy the string “My Textin dest1
STRLEN
Returns the length of a string.
Hardware All
Syntax
STRLEN(Char *Str) as int
Parameters
Str Pointer to the string
Return value:
Length of the string.
Example
Used variables:
Len int
Len=StrLen(”My Text”) return value 7
STRCMP
Comparing of two strings.
Hardware All
Syntax
STRCMP(Char *Str1, Char *Str2) as char
Parameters
Str1 Pointer to the first string
Str2 Pointer to the second string
Return value:
0 Equal strings
< String Str1 less than Str2
>0 String Str1 greater than Str2