CAPL Script

StrnCmp

Syntax

long strncmp(char s1[], char s2[], long len);

long strncmp(char s1[], 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. Form 2 starts the comparison ins2at the specified offset.

Parameters

s1 First string

s2

Second string

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.

on key 's'{char s1[7] = "Vector";char s2[7] = "Vector";if(strncmp(s1,s2,strlen(s1)))write("not equal");elsewrite("equal");}

strlen | strncat | strncpy | strncmp_off