GetShortValue Example for Delphi
Procedure TForm1.TestProc3();
var
nCount: Integer;
x: Integer;
nRet: Integer;
begin
LEADDicomDS1.EnableMethodErrors:= False;
//move to the root element
LEADDicomDS1.MoveFirstElement (False);
LEADDicomDS1.MoveRootElement ();
//insert a new element for the Short Values
LEADDicomDS1.InsertElement (False, TAG_RECORD_IN_USE_FLAG, VR_US, False, 0);
Edit1.Visible:= True;
Edit1.Text:= '';
//insert some short values into the element
LEADDicomDS1.ShortValueCount:= 5;
for x:= 0 to 5 - 1 do
LEADDicomDS1.ShortValues [x]:= x * 100;
//set the shorts
nRet:= LEADDicomDS1.SetShortValue (5);
if(nRet <> 0)then
begin
ShowMessage('Error');
Exit;
end;
LEADDicomDS1.ShortValueCount:= 0; //free the values
//get the value count
nCount:= LEADDicomDS1.GetValueCount ();
ShowMessage('There are ' + IntToStr(nCount) + ' values!');
//get the values
nRet:= LEADDicomDS1.GetShortValue (0, nCount);
if(nRet = 0)then
begin
For x:= 0 to LEADDicomDS1.ShortValueCount - 1 do
begin
//display each value separated by a ' X '
Edit1.Text:= Edit1.Text + ' X ' + IntToStr(LEADDicomDS1.ShortValues [x]);
end;
end;
ShowMessage('wait');
LEADDicomDS1.EnableMethodErrors:= True;
end;