|
The QMField() function extracts one or more components of a delimited string. It is analogous to the QMBasic FIELD() function.
The function arguments are:
| Src | is the string to be processed. |
| Delimiter | is the single character delimiter separating components of the string. |
| Start | is the number from one of the first component of Src to be returned. |
| Occurrences | is the number of delimited of components of Src to be returned. If less than one, one component is returned. |
The QMField() function returns the specified substring components of Src.
This function is evaluated on the client system and does not require a server connection to be open.
The example program fragments below take a variable Name holding a person's first and last names separated by a space and returns just their first name.
char * QMField(char * Src, char * Delimiter, int Start, int Occurrences)
FirstName = QMField(Name, " ", 1, 1);
The returned pointer references a dynamically allocated memory area that must be released using QMFree() when no longer needed.
|
QMField(ByVal Src as String, ByVal Delimiter as String, ByVal Start as Integer, Optional ByVal Occurrences as Integer) as String
FirstName = QMField(Name, " ", 1)
The Occurrences argument defaults to 1 if omitted.
|
This function is not supported by the QMClient class module as it is a QMBasic function.
|
String Field(String Src, char Delimiter, int Start, int Occurrences)
FirstName = qm.Field(Name, " ", 1, 1);
|
Field(Src, Delimiter, Start, Occurrences)
FirstName = qm.Field(Name, " ", 1, 1)
|
|