Hello,
I want to update a row in an infotable in my CSDK
I have an infotable i am iterating via twList_Foreach
my infotable contain sevaral fields : Id, field A, field B, field C
I want to iterate my infotable row by row if i found the id already exist, i have to update the fields (A, B, C)
This my code:
twList_Foreach(it_List, search_ForeachHandler, params)
in the param i am passing the id to serach
in my search_ForeachHandler:
static int search_ForeachHandler(void* key, size_t keySize, void* currentValue, void* userData) {
twInfoTableRow* value = (twInfoTableRow*)currentValue;
//id to search
int* id= (int*)userData;
if (*id == twInfoTableRow_GetEntry(value, 0)) {
//Get Field A
twPrimitive* it_field_a = twInfoTableRow_GetEntry(value, 1);
it_field_a = TW_MAKE_STRING(params->message_id);
//Same for field B et C ....
return TW_FOREACH_EXIT;
}
return TW_FOREACH_CONTINUE;
}
I thought I am modifying row field by address. but apparently it's a copy.
Do you have an idea how to update field in the row of an infotable.
Thank you for your help.
Solved! Go to Solution.
You could remove and re-add the row, or maybe twList_ReplaceValue could be of help?
You could remove and re-add the row, or maybe twList_ReplaceValue could be of help?