How does Delphi master convert the following code to VB6 code
Code:function TAPETag.RemoveTagFromFile(sFile: WideString): Boolean; var SourceFile: TTntFileStream; Footer: RTagHeader; ID3: pointer; begin Result := ReadFooter(sFile, Footer); { Process data if loaded and footer valid } if (Result) and (Footer.ID = APE_ID) then begin SourceFile := TTntFileStream.Create(sFile, fmOpenReadWrite or fmShareDenyWrite); { If there is an ID3v1 tag roaming around behind the APE tag, we have to buffer it } if Footer.DataShift = ID3V1_TAG_SIZE then begin GetMem(ID3,ID3V1_TAG_SIZE); SourceFile.Seek(footer.FileSize - footer.DataShift, soFromBeginning); SourceFile.Read(ID3^, ID3V1_TAG_SIZE); end; { If this is an APEv2, header size must be added } if (Footer.Flags shr 31) > 0 then Inc(Footer.Size, APE_TAG_HEADER_SIZE); SourceFile.Seek(Footer.FileSize - footer.Size-Footer.DataShift, soFromBeginning); { If there is an ID3v1 tag roaming around, we copy it } if Footer.DataShift = ID3V1_TAG_SIZE then begin SourceFile.Write(ID3^, ID3V1_TAG_SIZE); FreeMem(ID3,128); end; SourceFile.Seek(Footer.FileSize-Footer.Size, soFromBeginning); //truncate SourceFile.Size := SourceFile.Position; SourceFile.Free; end; end;




Reply With Quote