home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 492.lha / PowerPlatform_v1.1 / Rexx / GIFtoSHAM.APP < prev    next >
Encoding:
Text File  |  1991-04-06  |  2.1 KB  |  52 lines

  1. /************************************************************************/
  2. /* This ARexx EXEC will convert a GIF file into SHAM format. It is      */
  3. /* designed to run under PowerPlatform.                                 */
  4. /*                                                                      */
  5. /*                                            ==> MCW 06/05/90 <==      */
  6. /*                                                                      */
  7. /*                   Copyright © 1990 Martin C. Warnett.                */
  8. /************************************************************************/
  9.  
  10. trace off
  11.  
  12. parse arg fname                             /* Get file name            */
  13.  
  14. if fname = '' then do                       /* No file name specified?  */
  15.     'Message Invalid file name specified'   /* Display error message    */
  16.     'Beep'
  17.     return 0
  18. end
  19.  
  20. gif_ftp = lastpos(".", fname)               /* Find file type position  */
  21. gif_fnp = lastpos("/", fname)               /* Find file name position  */
  22.  
  23. if gif_fnp = 0 then do                       /* No path?                */
  24.     gif_fnp = lastpos(":", fname)            /* Find end of disk name   */
  25. end
  26.                                             /* Get filename             */
  27. gif_name = substr(fname, gif_fnp+1, gif_ftp-gif_fnp-1)
  28. gif_type = substr(fname, gif_ftp + 1)       /* Get filetype             */
  29. gif_type = upper(gif_type)                  /* Filetype to UPPERCASE    */
  30.  
  31. if gif_type ~= "GIF" then do                /* Invalid filename/type?   */
  32.     'message Invalid file type'             /* Msg in ARdu title bar    */
  33.     return 8                                /* Return with error        */
  34. end
  35.  
  36. address command 'GIFtoTMP' fname gif_name
  37. final_rc = rc
  38. address command 'SuperCon' gif_name
  39. final_rc = final_rc + rc
  40. address command 'delete' gif_name
  41. address command 'rename FROM' gif_name || '.sham TO' gif_name || '.SHAM'
  42. final_rc = final_rc + rc
  43.  
  44. if final_rc > 0 then do
  45.     say
  46.     say 'GIF to SHAM conversion failed.'
  47.     pull trash
  48. end
  49.  
  50. return 0                                    /* Successful completion    */
  51.  
  52.