Technical Reference > CtAPI Functions > Function Reference > ctListDelete

ctListDelete

Frees a tag created with ctListAdd. Your program is permitted to call ctListDelete() while a read or write is pending on another thread. The ctListWrite() and ctListRead() will return once the tag has been deleted.

Syntax

ctListDelete(hTag)

hTag

Type: HANDLE
Input/output: Input
Description: The handle to the tag, as returned from ctListAdd().

Return Value

If the function succeeds, the return value is TRUE. If the function does not succeed, the return value is FALSE. To get extended error information, call GetLastError().

Related Functions

ctOpen, ctListNew, ctListFree, ctListAdd, ctListRead, ctListWrite, ctListData, ctListItem

Example

HANDLE		 hList;
HANDLE hTagOne;
HANDLE hTagTwo;
hList = ctListNew(hCTAPI, 0);
hTagOne = ctListAdd(hList, "TagOne");
hTagTwo = ctListAdd(hList, "TagTwo");
ctListRead(hList, NULL); // read TagOne and TagTwo
ctListData(hList, hTagOne, sBufOne, sizeof(sBufOne), 0);
ctListData(hList, hTagTwo, sBufTwo, sizeof(sBufTwo) , 0);
ctListDelete(hTagOne); // delete TagOne;
ctListRead(hList, NULL); // read TagTwo only
ctListData(hList, hTagTwo, sBufTwo, sizeof(sBufTwo) , 0);