For the original question, the base.StringBuffer.getIndexOf documentation has an example parsing a string by a word
http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_ClassStringBuffer_getIndexOf.html. The getIndexOf and subString methods available in both String and StringBuffer would allow you to attempt to do what you are attempting to do.
getIndexOf(" AND ",pos) would be better than getIndexOf("AND",pos), but you have to be aware that even " AND " could be part of the entered value, as in "SMITH AND JONES", or part of the generated value "A..B" becomes "fieldname between 'A' and 'B'". Parsing SQL can be a slippery slope ...
I suspect you want to make the problem easier. That is append the "*" during the CONSTRUCT as Seb suggested using the set and get field buffer methods.
http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_BuiltInFunctions_FGL_DIALOG_SETBUFFER.htmlhttp://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_BuiltInFunctions_FGL_DIALOG_GETBUFFER.htmlWhat I will also throw into the mix is to use multi-dialog. So for the field you are appending '*" to, that is in an INPUT, and you generate and append a string to the end of the where clause generated by the CONSTRUCT.
DIALOG
INPUT BY NAME id
END INPUT
CONSTRUCT where_part BY NAME ON ...
END CONSTRUCT
END DIALOG
LET where_part = where_part, SFMT(" AND id MATCHES '*%1*'", id)
Or you have multi-dialog with a CONSTRUCT for each individual field.
DIALOG
CONSTRUCT BY NAME field1_sql ON field1
END CONSTRUCT
CONSTRUCT BY NAME field2_sql ON field2
END CONSTRUCT
... etc...
END DIALOG
then it is a case of manipulating the individual field SQL before concatenating back together. This approach is good for adding UPPER() etc for case insensitive, or for doing OR instead of AND.
Reuben