CAPL Script

StrnCmpOff

Syntax

long strncmp_off(char s1[], long s1offset, char s2[], long s2offset, long len);

Function

This function comparess1withs2for a maximum oflenbytes. If they are identical the functional result is 0.Ifs1is less thans2the result is -1, else +1.Comparison starts ins1ats1offsetand ins2ats2offset.

Parameters

s1 First string

s2

Second string

s1offset

Offset ins1in bytes

s2offset

Offset ins2in bytes

len

Maximum number of bytes to compare

Return Values

-1 if s1 is less than s2.

1 if s2 is less than s1.

0 if the strings are equal.

char s1[18] = "Vector Informatik";char s2[11] = "Informatik";if (strncmp_off(s1, 7, s2, 0, strlen(s2)) == 0)write("Equal!");elsewrite("Unequal!");

strlen | strncat | strncpy | strncmp