home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / Editor / Edge1721.DMS / Edge1721.adf / ExtraStuff / Edge_MoreRexx.lha / UpdateVersion.edge < prev   
Encoding:
Text File  |  1993-11-09  |  1.0 KB  |  58 lines

  1.  
  2. /*
  3. ** $VER: UpdateVersion.edge 1.2 (Sunday 08-Aug-93 02:54:44)
  4. ** 
  5. ** Find and update the version string with new date and revision.
  6. **
  7. ** Written by Thomas liljetoft
  8. */
  9.  
  10. options results
  11.  
  12. /* get date and filename */
  13.  
  14. 'getenvvar' _ge_date
  15. timestamp = result
  16. 'getenvvar' _fe_name
  17. filename = result
  18.  
  19. /* save old flags */
  20. 'getenvvar' _fe_flags
  21. oldflags = result
  22.  
  23. /* find the version string, e.g '$VER: <filename>' */
  24.  
  25. 'position' sof
  26. 'find' '"'"$VER: "filename'"' 0 1 0 0 0
  27. if RC ~= 0 then
  28.     do
  29.  
  30.     /* no version string found, say so and exit */
  31.  
  32.     'beepscreen'
  33.     'requestnotify' '"No version string found"'
  34.     'putenvvar' _fe_flags oldflags
  35.     exit(10)
  36.     end
  37.  
  38. /* find the beginning of the date, and get the revision number */
  39.  
  40. 'find' '"("'
  41. 'cursor' left 1
  42. 'copy' rb back word
  43. revision = result
  44.  
  45. /* delete the old revision number and date */
  46.  
  47. 'markblock'
  48. 'find' '")"'
  49. 'cursor right 1'
  50. 'erase'
  51.  
  52. /* insert the new revision number (old revision + 1) and the new date */
  53.  
  54. 'text' '"'revision + 1" ("timestamp")"'"' raw
  55. 'putenvvar' _fe_flags oldflags
  56.  
  57. exit(0)
  58.