home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / srcmac.zip / VLOG.REX < prev   
OS/2 REXX Batch file  |  1993-01-14  |  2KB  |  67 lines

  1. /* VLOG.rex - PVCS VLOG on the current workfile
  2.  
  3.   This macro does a VLOG on the current viewed work file and SLSTARTs
  4.   the output to SourceLink.
  5.  
  6.   Customizations necessary:
  7.   1. PVCSVLOG specs where the VLOG executable is.
  8.   2. sLogFile is the directory where your log file in question is.
  9.      Remember the final '\'.
  10. */
  11.  
  12. /* -------------------------- Alias list ----------------------------*/
  13.  
  14. /* Setup full path to VLOG */
  15. pvcsvlog = 'e:\pvcs\vlog'
  16.  
  17.       /* The directory path where the logfile can be found */
  18. sLogFile = 'e:\pvcs\macros\test\src\'
  19.  
  20. /* ---------------------------- Begin ------------------------------ */
  21.  
  22. /* Get the currently viewed work file */
  23. 's_get_curr_filename sCurrFile'
  24.  if \(RC = 0) then
  25.    do
  26.    's_msg "Could not get the currently viewed file","Error Code is:",' rc ',resp'
  27.    exit
  28.    end
  29.    
  30. /* Build the file path strings */
  31. sDrv = filespec("drive",sCurrFile)
  32. sFileName = filespec("name",sCurrFile)
  33. sPath = filespec("path",sCurrFile)
  34.   
  35. iLp = lastpos('.',sFileName)
  36. sNameOnly = substr(sFileName,1,iLp-1)
  37.   
  38. iLp = lastpos('.',sCurrFile)
  39. sExtension = substr(sCurrFile,iLp+1)
  40.   
  41. /* Make the extension into PVCS standard form, adding a 'V' in the 3rd position */
  42. if (length(sExtension) = 1) then
  43.   sLFExt = insert(sExtension,'_V')
  44. else if (length(sExtension) = 2) then
  45.    sLFExt = insert(sExtension,'V')
  46. else if (length(sExtension) = 3) then
  47.   sLFExt = overlay('V',sExtension,3)
  48. else
  49.   sLFExt = '__V'
  50.   
  51. /* Build the logfile name */
  52. sLogFile = insert(sLogFile,sNameOnly)
  53. sLogFile = insert(sLogFile,'.')
  54. sLogFile = insert(sLogFile,sLFExt)
  55.  
  56. cmd = pvcsvlog '-xeerr -xooutput' sLogFile
  57. cmd
  58.  
  59. if (rc=0) then
  60.   slstart output
  61. else
  62.   do
  63.   's_msg "VLOG did not work","Error Code was:",' rc ',resp'
  64.   'slstart err'
  65.   end
  66.  
  67. /* fini */