$VER: AddCD.quickfile 1.00e (5-Aug-2000) by R.Florac
Add all the records for a CD to the Disques-K7 database.
This script needs some work to be fully working...
*/
options results
'REQCHOICE "This script adds all the records\10needed to handle a CD\10(one record per track).\10But you''ll have to edit\10the records to complete\10the data.\10Do-you want to continue ?"'
if rc=5 then exit
'REQSTRING "" "Album title ?"'
if rc~=0 then exit
titre=result
if titre="" then exit
'REQSTRING "" "Name of the principal performer ?"'
if rc~=0 then exit
interprete=result
if interprete="" then exit
'REQSTRING "19" "Year of parution ?"'
if rc~=0 then exit
parution=result
'REQSTRING "" "Total time ?"'
if rc~=0 then exit
duree=result
'REQSTRING "" "Number of tracks ?"'
if rc~=0 then exit
plages=result
if plages="" then exit
if datatype(plages)~=NUM then exit
if plages<1 then exit
'REQCHOICE "Album: 'titre'\10Performer: 'interprete'\10Year of parution: 'parution'\10Total time: 'duree'\10Tracks: 'plages'\10\10Do-you want to add\10this record to the base ?"'
if rc=5 then exit
'ShowAll ON'
'ClrRec'
'PutField Album "'titre'"'
if rc>0 then call signaler_erreur("Error writing field\10'titre album'\10(titre)")
'PutField Interprètes "'interprete'"'
if rc>0 then call signaler_erreur("Error writing field\10'interprète principal'\10(Interprètes)")
'PutField Interprète "'interprete'"'
if rc>0 then call signaler_erreur("Error writing field\10nom de l'interprète\10(Interprète)")
if datatype(parution)=NUM then do
'PutField Parution 'parution
if rc>0 then call signaler_erreur("Error writing field\10année de parution\10(Parution)")
end
'PutField Plages 'plages
if rc>0 then call signaler_erreur("Error writing field\10nombre de plages\10(plages)")
if datatype(left(duree,1))=NUM then do
'PutField "Durée totale" 'duree
if rc>0 then call signaler_erreur("Error writing field\10durée totale\10(duree)")
end
'PutField Plage 1'
'InsRec'
if rc>0 then call signaler_erreur("Erreur Insertion fiche\10(InsRec)")
'UpdRec'
if rc>0 then call signaler_erreur("Erreur Mise à jour fiche\10(UpdRec)")
do i=2 to plages
'ClrRec'
'PutField Album "'titre'"'
if rc>0 then call signaler_erreur("Error writing field\10Album title\10(titre)\10Track N°"||i)
'PutField Interprètes "'interprete'"'
if rc>0 then call signaler_erreur("Error writing field\10Principal performer\10(Interprètes)\10Track N°"||i)
'PutField Interprète "'interprete'"'
if rc>0 then call signaler_erreur("Error writing field\10name of the performer\10(interprète)\10Track N°"||i)
if datatype(parution)=NUM then do
'PutField Parution 'parution
if rc>0 then call signaler_erreur("Error writing field\10parution year\10(parution)\10Track N°"||i)
end
'PutField Plages 'plages
if rc>0 then call signaler_erreur("Error writing field\10number of tracks\10(Plages)\10Track N°"||i)
if datatype(left(duree,1))=NUM then do
'PutField "Durée totale" 'duree
if rc>0 then call signaler_erreur("Error writing field\10total time\10(duree)\10Track N°"||i)
end
'PutField Plage 'i
if rc>0 then call signaler_erreur("Error writing field\10track number\10(Plage)\10Track N°"||i)
'InsRec'
if rc>0 then call signaler_erreur("Error inserting record\10(InsRec)\10Track N°"||i)
'UpdRec'
if rc>0 then call signaler_erreur("Error updating record\10(UpdRec)\10Track N°"||i)
end
'SETVIEW SeeAllFields.View'
'REQMSG "You can edit the records now.\10The data for the CD have to\10be inserted to track 1."'