|
The QMDelete() function deletes a record from a file. It is analogous to the QMBasic DELETE statement.
The function arguments are:
| FileNo | is the file number returned by a previous QMOpen() call. |
| Id | is the id of the record to be deleted. |
The QMDelete function deletes the named record from the file open as FileNo. No error occurs if the record does not exist.
Applications should always obtain an update lock for a record before deleting it. The lock is released by this function.
The program fragment in the examples below opens the CLIENTS file, deletes the record identified by ClientNo, and then closes the file. Note the use of a record update lock to comply with recommended programming rules.
void QMDelete(int FileNo, char * Id)
fClients = QMOpen("CLIENTS");
QMRecordlock(fClients, ClientNo, TRUE, TRUE);
QMDelete(fClients, ClientNo);
QMClose(fClients);
|
QMDelete ByVal FileNo as Integer, ByVal Id as String
fClients = QMOpen("CLIENTS")
QMRecordlock(fClients, ClientNo, True, True)
QMDelete(fClients, ClientNo)
QMClose(fClients)
|
Delete(FileNo, Id)
fClients = session->Open("CLIENTS")
session->Recordlock(fClients, ClientNo, @true, @true)
session->Delete(fClients, ClientNo)
session->Close(fClients)
|
Delete(int FileNo, String Id)
fClients = qm.Open("CLIENTS");
qm.Recordlock(fClients, ClientNo, true, true);
qm.Delete(fClients, ClientNo);
qm.Close(fClients);
|
Delete(FileNo, Id)
fClients = qm.Open("CLIENTS")
qm.Recordlock(fClients, ClientNo, True, True);
qm.Delete(fClients, ClientNo);
qm.Close(fClients);
|
|