I need to search a text field for a string of characters. How in C/AL do I code the expression to include wild card characters? For example: I need to find the string " foo " anywhere in the field comments. What is the correct code to say: if comment = * foo * then …
STRPOS (String) Use this function to search for a substring inside a string. Position := STRPOS(String, SubString) Position Data type: integer The position of SubString in String. If the system cannot find SubString, it returns zero (0). Comments The STRPOS function only returns the position of the first occurrence of the substring. Example This example shows how to use the STRPOS function. String := Text000; SubStr := Text001 Pos := STRPOS(String, SubStr); MESSAGE(Text002 + Text003 + Text004, SubStr, String, Pos); // The STRPOS function is case sensitive. Furthermore it only // returns the position of the 1st occurrence of the substring. Does this help? It is from the CSIDE Reference Guide.
That was what I needed. Thanks for the help!