QMDel()

Top  Previous  Next

 

The QMDel() function deletes a field, value or subvalue from a dynamic array.

 

 

Format

 

VBQMDel(ByVal Src as String, ByVal Fno as Integer, ByVal Vno as Integer, ByVal Svno as Integer) as String

 

Cchar * QMDel(char * Src, int Fno, int Vno, int Svno)

 

where

 

Srcis the dynamic array to be processed

 

Fnois the number of the field to be deleted. If less than 1, 1 is assumed

 

Vnois the number of the value to be deleted. If less than 1, the entire field is deleted.

 

Svnois the number of the subvalue to be deleted. If less than 1, the entire value is deleted.

 

 

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.