GetConvertValue Example for C++Builder
int nRet;
Cardinal uCount, x;
/* add some values to the element */
/* note, this will only work for elements that have a VR that supports multiple values */
LEADDicom1->EnableMethodErrors = false;
LEADDicom1->StringValueCount = 3;
LEADDicom1->StringValues[0] = "3.45";
LEADDicom1->StringValues[1] = "9.99";
LEADDicom1->StringValues[2] = "1.11";
nRet = LEADDicom1->SetConvertValue();
if(nRet != SUCCESS)
{
ShowMessage("SetConvertValue failed. Error No. " + IntToStr(nRet));
return;
}
/* free the current values */
LEADDicom1->StringValueCount = 0;
/* now get the values and display them */
nRet = LEADDicom1->GetConvertValue();
if(nRet == SUCCESS)
{
uCount = LEADDicom1->StringValueCount;
Memo1->Lines->Clear();
for(x=0 ;x<uCount; x++)
/* display each value on a separate line */
Memo1->Lines->Add(LEADDicom1->StringValues[x]);
}
LEADDicom1->EnableMethodErrors = true;