home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2005 June / PCpro_2005_06.ISO / files / opensource / amc / amc_install.exe / {app} / Scripts / ClearField.ifs < prev    next >
Encoding:
Text File  |  2005-02-05  |  3.9 KB  |  105 lines

  1. (***************************************************
  2.  
  3. Ant Movie Catalog importation script
  4. www.antp.be/software/moviecatalog/
  5.  
  6. [Infos]
  7. Authors=scorpion7552
  8. Title=ClearField
  9. Description=efface un champ/clear a field 
  10. Site=
  11. Language=EN,FR
  12. Version=1.0
  13. Requires=3.5.0
  14. Comments=Remise α blanc d'un champ (si modifiable)/Clear a field (if modifiable)
  15. License=This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
  16. GetInfo=0
  17.  
  18. [Options]
  19.  
  20. ***************************************************)
  21. program ClearField;
  22. var
  23.     abort: string;
  24.     fld1: integer;
  25.  
  26. //------------------------------------------------------------------------------
  27. // creates fields list and returns the selected field number
  28. //------------------------------------------------------------------------------
  29. function SelectField :integer;
  30. var
  31.     fld: string;
  32.  
  33. begin
  34.     PickTreeClear;
  35.     PickTreeAdd('SΘlectionner le champ α effacer/Select the field to clear', '')
  36. // create list
  37.     AddFieldToList(fieldMedia, 'Label du support/Media label');
  38.     AddFieldToList(fieldMediaType, 'Type de support/Media Type');
  39.     AddFieldToList(fieldSource, 'Origine/Media Source');
  40.     AddFieldToList(fieldBorrower, 'EmpruntΘ par/Borrower');
  41.     AddFieldToList(fieldRating, 'Note/Rating');
  42.     AddFieldToList(fieldOriginalTitle, 'Titre original/Original Title');
  43.     AddFieldToList(fieldTranslatedTitle, 'Titre Traduit/Translated Title');
  44.     AddFieldToList(fieldDirector, 'RΘalisateur/Director');
  45.     AddFieldToList(fieldProducer, 'Producteur/Producer');
  46.     AddFieldToList(fieldCountry, 'Pays/Country');
  47.     AddFieldToList(fieldCategory, 'CatΘgorie/Category');
  48.     AddFieldToList(fieldActors, 'Acteurs/Actors');
  49.     AddFieldToList(fieldYear, 'AnnΘe/Year');
  50.     AddFieldToList(fieldLength, 'DurΘe/Length');
  51.     AddFieldToList(fieldUrl, 'Adresse  Web/URL');
  52.     AddFieldToList(fieldDescription, 'Description');
  53.     AddFieldToList(fieldComments, 'Commentaires/Comments');
  54.     AddFieldToList(fieldVideoFormat, 'Format vidΘo/Video format');
  55.     AddFieldToList(fieldVideoBitrate, 'Video bitrate');
  56.     AddFieldToList(fieldAudioFormat, 'Format audio/Audio format');
  57.     AddFieldToList(fieldAudioBitrate, 'Audio bitrate');
  58.     AddFieldToList(fieldResolution, 'RΘsolution/Resolution');
  59.     AddFieldToList(fieldFrameRate, 'FrΘquence/Frame rate');
  60.     AddFieldToList(fieldLanguages, 'Langues/Languages');
  61.     AddFieldToList(fieldSubtitles, 'Sous-titres/Subtitles');
  62.     AddFieldToList(fieldSize, 'Taille/Size');
  63.     AddFieldToList(fieldDisks, 'Disques/Disks');
  64. //
  65.     PickTreeExec(fld);
  66.     result := StrToInt(fld,0);
  67. end;
  68.  
  69. //------------------------------------------------------------------------------
  70. // add a field to the selection list
  71. // AddFieldToList(fieldnumber, text_for_display);
  72. //------------------------------------------------------------------------------
  73. procedure AddFieldToList(fldn: integer; str:string);
  74. begin
  75. // if fieldnumber is modifiable
  76.     if CanSetPicture then 
  77.         PickTreeAdd(str, IntToStr(fldn));
  78. end;
  79.  
  80. //------------------------------------------------------------------------------
  81. //  start here
  82. //------------------------------------------------------------------------------  
  83. begin
  84.     if abort = 'o' then                             // selection has been canceled
  85.         exit;
  86.     if fld1 = 0 then                          // first time: select field to clear
  87. // note: number = 0 = fieldNumber: not selectable here
  88.     begin
  89.         if not CheckVersion(3,5,0) then
  90.         begin
  91.             ShowMessage('This script requires a newer version of Ant Movie Catalog (at least the version 3.5.0)');        
  92.             abort := 'o';
  93.             exit;
  94.         end;
  95.         fld1 := SelectField;
  96.         if fld1 = 0 then
  97.         begin
  98.             abort := 'o';                                              // no selection
  99.             exit;
  100.         end;
  101.     end;
  102. // clear the field for the current item
  103.     SetField(fld1, '');
  104. end.
  105.