GetConvertValue Example for Delphi

var
   nRet: Integer;
   uCount: Cardinal;
   x: Cardinal;
begin
   { 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 then
   begin
      ShowMessage('SetConvertValue failed. Error No. ' + IntToStr(nRet));
      exit;
   end;
   { free the current values }
   LEADDicom1.StringValueCount := 0;
   { now get the values and display them }
   nRet := LEADDicom1.GetConvertValue();
   If nRet = SUCCESS Then
   begin
      uCount := LEADDicom1.StringValueCount;
      Memo1.Lines.Clear();
      For x := 0 To uCount - 1 do
         { display each value on a separate line }
         Memo1.Lines.Add(LEADDicom1.StringValues[x]);
   end;
   LEADDicom1.EnableMethodErrors := true;
end;