InsertVR Example for Delphi
var
nRet, nCode, nRestrict: Integer;
sOutput: String;
begin
LEADDicom1.EnableMethodErrors := false;
nCode := 20322;
nRet := LEADDicom1.FindVR(nCode);
If nRet = SUCCESS Then
begin
ShowMessage('Already Exists!');
Exit;
End;
LEADDicom1.EnableMethodErrors := true;
try
nRestrict := VR_FIXED or VR_TEXT;
LEADDicom1.InsertVR(nCode, 'My Test VR', 64, nRestrict, 1);
{ add item to the ListView control }
sOutput := 'VR Inserted:' + #13 +
'Code: ' + IntToStr(LEADDicom1.CurrentVR.Code) + #13 +
'Name: ' + LEADDicom1.CurrentVR.Name + #13 +
'Length: ' + IntToStr(LEADDicom1.CurrentVR.Length) + #13 +
'Restrict: ' + IntToStr(LEADDicom1.CurrentVR.Restrict) + #13 +
'UnitSize: ' + IntToStr(LEADDicom1.CurrentVR.UnitSize);
ShowMessage(sOutput);
except
ShowMessage('Error Number: ' + IntToStr(LEADDicom1.Error));
end;
End;