home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Utilities / QuickFile / ARexx / AddCD.quickfile next >
Text File  |  2000-08-05  |  4KB  |  105 lines

  1. /*
  2. $VER: AddCD.quickfile 1.00e (5-Aug-2000) by R.Florac
  3.  
  4. Add all the records for a CD to the Disques-K7 database.
  5.  
  6. This script needs some work to be fully working...
  7. */
  8.  
  9. options results
  10.  
  11. '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 ?"'
  12. if rc=5 then exit
  13.  
  14. 'REQSTRING "" "Album title ?"'
  15. if rc~=0 then exit
  16. titre=result
  17. if titre="" then exit
  18.  
  19. 'REQSTRING "" "Name of the principal performer ?"'
  20. if rc~=0 then exit
  21. interprete=result
  22. if interprete="" then exit
  23.  
  24. 'REQSTRING "19" "Year of parution ?"'
  25. if rc~=0 then exit
  26. parution=result
  27.  
  28. 'REQSTRING "" "Total time ?"'
  29. if rc~=0 then exit
  30. duree=result
  31.  
  32. 'REQSTRING "" "Number of tracks ?"'
  33. if rc~=0 then exit
  34. plages=result
  35. if plages="" then exit
  36. if datatype(plages)~=NUM then exit
  37. if plages<1 then exit
  38.  
  39. '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 ?"'
  40. if rc=5 then exit
  41.  
  42. 'ShowAll ON'
  43.  
  44. 'ClrRec'
  45. 'PutField Album "'titre'"'
  46. if rc>0 then call signaler_erreur("Error writing field\10'titre album'\10(titre)")
  47. 'PutField Interprètes "'interprete'"'
  48. if rc>0 then call signaler_erreur("Error writing field\10'interprète principal'\10(Interprètes)")
  49. 'PutField Interprète "'interprete'"'
  50. if rc>0 then call signaler_erreur("Error writing field\10nom de l'interprète\10(Interprète)")
  51. if datatype(parution)=NUM then do
  52.     'PutField Parution 'parution
  53.     if rc>0 then call signaler_erreur("Error writing field\10année de parution\10(Parution)")
  54. end
  55. 'PutField Plages 'plages
  56. if rc>0 then call signaler_erreur("Error writing field\10nombre de plages\10(plages)")
  57. if datatype(left(duree,1))=NUM then do
  58.     'PutField "Durée totale" 'duree
  59.     if rc>0 then call signaler_erreur("Error writing field\10durée totale\10(duree)")
  60. end
  61. 'PutField Plage 1'
  62. 'InsRec'
  63. if rc>0 then call signaler_erreur("Erreur Insertion fiche\10(InsRec)")
  64. 'UpdRec'
  65. if rc>0 then call signaler_erreur("Erreur Mise à jour fiche\10(UpdRec)")
  66.  
  67. do i=2 to plages
  68.     'ClrRec'
  69.     'PutField Album "'titre'"'
  70.     if rc>0 then call signaler_erreur("Error writing field\10Album title\10(titre)\10Track N°"||i)
  71.     'PutField Interprètes "'interprete'"'
  72.     if rc>0 then call signaler_erreur("Error writing field\10Principal performer\10(Interprètes)\10Track N°"||i)
  73.     'PutField Interprète "'interprete'"'
  74.     if rc>0 then call signaler_erreur("Error writing field\10name of the performer\10(interprète)\10Track N°"||i)
  75.     if datatype(parution)=NUM then do
  76.     'PutField Parution 'parution
  77.     if rc>0 then call signaler_erreur("Error writing field\10parution year\10(parution)\10Track N°"||i)
  78.     end
  79.     'PutField Plages 'plages
  80.     if rc>0 then call signaler_erreur("Error writing field\10number of tracks\10(Plages)\10Track N°"||i)
  81.     if datatype(left(duree,1))=NUM then do
  82.     'PutField "Durée totale" 'duree
  83.     if rc>0 then call signaler_erreur("Error writing field\10total time\10(duree)\10Track N°"||i)
  84.     end
  85.     'PutField Plage 'i
  86.     if rc>0 then call signaler_erreur("Error writing field\10track number\10(Plage)\10Track N°"||i)
  87.     'InsRec'
  88.     if rc>0 then call signaler_erreur("Error inserting record\10(InsRec)\10Track N°"||i)
  89.     'UpdRec'
  90.     if rc>0 then call signaler_erreur("Error updating record\10(UpdRec)\10Track N°"||i)
  91. end
  92. 'SETVIEW SeeAllFields.View'
  93. 'REQMSG "You can edit the records now.\10The data for the CD have to\10be inserted to track 1."'
  94. exit
  95.  
  96. signaler_erreur: procedure
  97.     parse arg message
  98.     if message ~= "" then do
  99.     'REQMSG "'message'"'
  100.     end
  101.     else do
  102.     'REQMSG "Error writing in the base"'
  103.     end
  104. exit
  105.