GetLongValue Example for Delphi
Procedure TForm1.TestProc4();
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 Long Values
LEADDicomDS1.InsertElement (False, TAG_OFFSET_FIRST_ROOT_DIRECTORY, VR_UL, False, 0);
Edit1.Visible:= True;
Edit1.Text:= '';
//insert some long values into the element
LEADDicomDS1.LongValueCount:= 5;
for x:= 0 to 5 - 1 do
LEADDicomDS1.LongValues [x]:= x * 100000;
//set the longs
nRet:= LEADDicomDS1.SetLongValue (5);
if(nRet <> 0)then
begin
ShowMessage('Error');
Exit;
end;
LEADDicomDS1.LongValueCount:= 0; //free the values
//get the value count
nCount:= LEADDicomDS1.GetValueCount ();
ShowMessage('There are ' + IntToStr(nCount) + ' values!');
//get the values
nRet:= LEADDicomDS1.GetLongValue (0, nCount);
if(nRet = 0)then
begin
for x:= 0 to LEADDicomDS1.LongValueCount - 1 do
begin
//display each value separated by a ' X '
Edit1.Text:= Edit1.Text + ' X ' + IntToStr(LEADDicomDS1.LongValues [x]);
end;
end;
LEADDicomDS1.EnableMethodErrors:= True;
ShowMessage('wait');
end;