LIKE function

Purpose: LIKE compares a string against a pattern.


 Syntax:

 RetVal% = LIKE(Buffer$, Pattern$)

 Parameters:

  • RetVal% Returns 1 if Pattern$ is found in Buffer$. Returns 0 if Pattern$ is not found in Buffer$.
  • 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.

Example:


 DIM RetVal AS INTEGER

 RetVal = LIKE("abcdefg","*d?f*") 
 PRINT RetVal ' This returns 1(true)
 RetVal = LIKE("abcdefg","*df?")  
 PRINT RetVal ' This returns 0(false)