---------------------------
Debugger Exception Notification
---------------------------
Project Jukebox.exe raised exception class EConvertError with message ''' is not a valid integer value'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
Anexo una imagne donde marca el error, el código es el siguiente:
delphi
procedure TForm1.Process(Path: string; const Mask: string); var sr: TSearchRec; Artista, Album, Titulo, Ruta, Ano, Calidad, Genero, Comentario: String; begin Path := Path + PathDelim; if FindFirst(Path + '*.*', faAnyFile, sr) = 0 then begin repeat if (sr.Attr and faDirectory) <> 0 then if (sr.Name <> '.') and (sr.Name <> '..') then Process(Path + sr.Name, Mask) else else if Pos(ExtractFileExt(sr.Name) + '.', '.' + Mask + '.') > 1 then ObtenerID3Tag(sr.Name,Titulo,Artista,Album,Ano,Genero,Comentario); Ruta := Path + sr.Name; if cdsCanciones.Active = False then begin cdsCanciones.Open; end; cdsCanciones.Last; cdsCanciones.Insert; cdsCanciones.FieldByName('ID').Value := NULL; cdsCanciones.FieldByName('Artista').AsString := Artista; cdsCanciones.FieldByName('Titulo').AsString := Titulo; cdsCanciones.FieldByName('Album').AsString := Album; cdsCanciones.FieldByName('Genero').AsString := Genero; cdsCanciones.FieldByName('Ano').AsInteger := StrToInt(Ano); cdsCanciones.FieldByName('Calidad').AsInteger:= StrToInt(Calidad); cdsCanciones.FieldByName('Ruta').AsString := Ruta; cdsCanciones.Post; until FindNext(sr) <> 0; FindClose(sr); end; end;
El procedimiento ObtenerID3Tag es éste:
delphi
procedure ObtenerID3Tag(mp3File: string; Title,Artist,Album,Year,Genre,Comment: String); var ID3 : TID3Rec; fmp3: TFileStream; begin fmp3:=TFileStream.Create(mp3File, fmOpenRead); try fmp3.position:=fmp3.size-128; fmp3.Read(ID3,SizeOf(ID3)); finally fmp3.free; end; if ID3.Tag <> 'TAG' then begin Title :=''; Artist :=''; Album :=''; Year :=''; Genre :=''; Comment :=''; end else begin Title := ID3.Titulo; Artist := ID3.Artista; Album := ID3.Album; Year := ID3.Ano; if ID3.Genero in [0..MaxID3Genre] then Genre := PCHar(Genre[ID3.Genero]) else Genre := IntToStr(ID3.Genero); Comment :=ID3.Comentario; end; end;
¿Donde puede ser el problema? .
Saludos.