GetPresentationResult Example for Delphi

var
   x: Integer;
   nID: Integer;
   nRes: Integer;   
   strOut: String;
begin
   //create the Associate Class as Request
   LEADDICOMNet1.CreateAssociate (True);
   //set the Associate to the default
   LEADDICOMNet1.DefaultAssociate (LEADDICOMNet1.hPDU);

   //get current results for each Presentation Context
   strOut:= '';
   for x:= 0 to LEADDICOMNet1.GetPresentationCount (LEADDICOMNet1.hPDU) - 1 do
   begin
      nID:= LEADDICOMNet1.GetPresentationID (LEADDICOMNet1.hPDU, x);
      nRes:= LEADDICOMNet1.GetPresentationResult (LEADDICOMNet1.hPDU, nID);
      strOut:= strOut + IntToStr(nRes);
      strOut:= strOut + Chr(13);
   end;
   ShowMessage(strOut);

   //change all results to 1
   for x:= 0 To LEADDICOMNet1.GetPresentationCount (LEADDICOMNet1.hPDU) - 1 do
   begin
      nID:= LEADDICOMNet1.GetPresentationID (LEADDICOMNet1.hPDU, x);
      LEADDICOMNet1.SetPresentationResult (LEADDICOMNet1.hPDU, nID, 1);
   end;
    
   //redisplay
   strOut:= '';
   for x:= 0 to LEADDICOMNet1.GetPresentationCount (LEADDICOMNet1.hPDU) - 1 do
   begin
      nID:= LEADDICOMNet1.GetPresentationID (LEADDICOMNet1.hPDU, x);
      strOut:= strOut + IntToStr(LEADDICOMNet1.GetPresentationResult (LEADDICOMNet1.hPDU, nID));
      strOut:= strOut + Chr(13);
   end;
   ShowMessage(strOut);
    
   LEADDICOMNet1.FreeAssociate (LEADDICOMNet1.hPDU);
end;