QMDel() |
|
|
The QMDel() function deletes a field, value or subvalue from a dynamic array. It is analogous to the QMBasic DELETE() function.
Format
where
The QMDel() function returns a new dynamic array with the given field, value or subvalue deleted. If the required item is not found, the original string is returned unchanged.
Note that in the C API library, a statement of the form rec = QMDel(rec, 2, 1, 0) will return a pointer to a newly allocated memory area, overwriting the rec pointer. The old memory is not freed by this call and it is therefore necessary to retain a pointer to the original rec string so that it can be freed later.
This function is evaluated on the client system and does not require a server connection to be open.
Examples
The above example returns a copy of the dynamic array Rec with field 1, value Pos removed.
Note that variables Rec and NewRec in the C example point to dynamically allocated memory areas that must be released using QMFree() when they are no longer needed. |