home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / Editor / Edge1721.DMS / Edge1721.adf / ExtraStuff / Edge_SasC.lha / rexx / hn_addprotos_sc6.edge < prev    next >
Encoding:
Text File  |  1993-11-09  |  1.5 KB  |  71 lines

  1. /* Edge macro: hn_addprotos
  2. **
  3. ** $VER: hn_addprotos_sc6.edge 1.2 (15-Maj-93 14:51:15)
  4. **
  5. ** Usage:    hn_addprotos
  6. **
  7. ** Synopsis: Add prototypes to SAS/C file
  8. **           (at cursor, if not done before)
  9. **           SAS/C V6 version
  10. **
  11. ** Author:   Henrik Nordström
  12. **           Ängsvägen 1
  13. **           756 45 Uppsala
  14. **           Sweden
  15. */
  16.  
  17. options results
  18.  
  19. call pragma(d,'edge:')
  20.  
  21. startstr='"/** Prototypes for "'
  22. endstr='"/** Prototypes END **/*n"'
  23.  
  24. /*FS:Find if done before */
  25. firsttime=0
  26. 'find find 'startstr' circular 1 words 0'
  27. if RC=0 then do
  28.     'blockoff'
  29.     'markblock'
  30.     'cursor up 1'
  31.     'find find 'endstr' forward 1'
  32.     'cursor down 1'
  33.     'erase'
  34.     'blockoff'
  35. end
  36. else firsttime=1
  37. /*FE:Find if done before */
  38.  
  39. /*FS:Start SCMSG */
  40. if ~show(p,'SC_SCMSG') then do
  41.   address command 'run <>nil: scmsg REXXONLY'
  42.   address command 'waitforport SC_SCMSG'
  43. end
  44. /*FE:SCMSG...*/
  45.  
  46. /*FS:Add prototypes at cursor */
  47. 'getenvvar _fe_name'
  48. fullname = result
  49. parse var fullname name '.' type
  50. address command 'sc errrexx >"echo:t:proto_'name'" gproto nogpdata gpstat gpfile="t:protos_'name'" "'name'"'
  51. call hn_readerr_c('t:proto_'name,fullname,1)
  52. if RESULT<10 then do
  53.    'position sol'
  54.    'include "t:protos_'name'"'
  55.    'delete char back'
  56.    'text 'endstr' RAW'
  57.    if firsttime then 'text "*n"'
  58.    'find find 'startstr' forward 0'
  59.    'position eol'
  60.    'delete char'
  61.    'position eol'
  62.    'delete char'
  63.    'position eol'
  64.    'delete char'
  65.    'position sol'
  66. end
  67. else 'undo'
  68. /*FE:Add prototypes at cursor */
  69.  
  70. exit(RC)
  71.