GetFloatValue Example for Delphi
Procedure TForm1.TestProc5();
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 Float Values
LEADDicomDS1.InsertElement (False, TAG_TABLE_OF_PARAMETER_VALUES, VR_FL, False, 0);
Edit1.Visible:= True;
Edit1.Text:= '';
//insert some float values into the element
LEADDicomDS1.FloatValueCount:= 5;
for x:= 0 to 5 - 1 do
LEADDicomDS1.FloatValues[x]:= x * 1.99;
//set the floats
nRet:= LEADDicomDS1.SetFloatValue (5);
if(nRet <> 0)then
begin
ShowMessage('Error');
Exit;
end;
LEADDicomDS1.FloatValueCount:= 0; //free the values
Edit1.Visible:= True;
Edit1.Text:= '';
//get the value count
nCount:= LEADDicomDS1.GetValueCount ();
ShowMessage('There are ' + IntToStr(nCount) + ' values!');
//get the values
nRet:= LEADDicomDS1.GetFloatValue (0, nCount);
if(nRet = 0)then
begin
For x:= 0 To LEADDicomDS1.FloatValueCount- 1 do
begin
//display each value separated by a ' X '
Edit1.Text:= Edit1.Text + ' X ' + FloatToStr(LEADDicomDS1.FloatValues [x]);
end;
end;
LEADDicomDS1.EnableMethodErrors:= True;
ShowMessage('wait');
end;