LIKE function

Purpose: LIKE compares a string against a pattern.


 Syntax:

 RetVal% = LIKE(Buffer$, Pattern$)

 Parameters:

  • Buffer$ String to which Pattern$ is compared.
  • Pattern$ String expression to be compared to Buffer$. Wildcard characters "*" and "?" can be used in Pattern$. "*" means any number of characters. "?" means any single character.

 Return Value:

  • RetVal%, the return value, is a 1 if Pattern$ is found in Buffer$. 0 is returned if Pattern$ is not found in Buffer$.

Example:


 DIM RetVal AS INTEGER

 RetVal = LIKE("abcdefg","*d?f*") 
 PRINT RetVal
 
 RetVal = LIKE("abcdefg","*df?")  
 PRINT RetVal