Navigation:  Reference > Functions >

LikeFields()

Print this Topic Previous pageReturn to chapter overviewNext page

 

LIKE(1,2)

 

PURPOSE

This function will return a logical value indicating whether the two fields are alike.  You may use the skeleton characters ? and * in the first field.

PARTS

1 f/c/eRequired - Comparison field 1.  If you are going to use the skeleton characters (variable character specifiers) ? or *, they must be in this field.  Must be an A type value.

 

2 f/c/eRequired - Comparison field 2.  Must be an A type field.

 

RETURN TYPE - L

If the fields match the function will return .T., otherwise .F.

 

COMMENTS

The character ? will match any other single character in that same position in field 2.  The character * will match all following characters from that position on.  If comparison field 1 is shorter than field 2 and the last character in field 1 is NOT * the fields will not match and .F. will be returned.  Differences in upper and lower case are treated as differences in characters.

 

EXAMPLE

define x type l

x = like('ABC','abc')

// same characters, different case, x = .F.

 

x = like('this*','this is a test')

// last character in comp fld1 is '*' and first chrs match

// x = .T.

 

x = like('th?s','this')

// ? will match any single chr., x = .T.

 

 


Page url: http://www.cassoftware.com/tas/manual/likefields().htm