home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / memacs32.zip / dev.cmd < prev    next >
OS/2 REXX Batch file  |  1993-08-07  |  4KB  |  112 lines

  1. ; More example macros for MicroEMACS 3.11c for Windows
  2. ; These are geared for Windows application development
  3.  
  4. ; Pierre Perret - July 1992
  5.  
  6. ; the following variables need to be adjusted to point to the
  7. ; proper files. The pathnames may not be appropriate on your
  8. ; system
  9. set %sdk30hlp "c:\sdk30\bin\sdkwin.hlp"
  10. set %sdk31hlp "c:\c700\bin\win31wh.hlp"
  11. set %sdk32hlp "d:\mstools\bin\api32wh.hlp"
  12. set %turbohlp "c:\bc30\bin\tcwhelp.hlp"
  13.  
  14. ; set this variable to point to the make command you want to be used
  15. set %make "nmake /f makefile"
  16.  
  17. ; utility macro to isolate the current help topic
  18. ; note that it modifies mark0 and mark7
  19. store-procedure get-help-keyword
  20.     7   set-mark
  21.     forward-character
  22.     !force previous-word
  23.     0   set-mark
  24.     end-of-word
  25.     set %Keyword $region
  26.     7   goto-mark
  27. !endm
  28.  
  29. ; This macro calls up the Win 3.0 SDK help on the curent topic
  30. ; it is complicated because it needs to append the type of the topic
  31. ; for proper matching in the help file.
  32. store-procedure Win30-Help
  33.     run get-help-keyword
  34.     !if &sequal %Keyword &upper %Keyword
  35.         ; keyword is all uppercase
  36.         set %tmp &sindex %Keyword "_"
  37.         !if ¬ &equal %tmp 0
  38.             ; there is an underscore in there...
  39.             !if &or &equal %tmp 3 &sequal &mid %Keyword 2 3 "BN_"
  40.                 ; the underscore is the 3rd character or
  41.                 ; the second to 4th characters are "BN_"
  42.                 set %KeywordType " message"
  43.             !else
  44.                 set %tmp 0
  45.             !endif
  46.         !endif
  47.         !if &equal %tmp 0
  48. *GetAdvice
  49.             write-message "What is it ? (S=data Structure, M=utility Macro, P=Printer escape)"
  50.             set %tmp &upper >k
  51.             !if &equal &sindex "SMP" %tmp 
  52.                 !goto GetAdvice
  53.             !endif
  54.             !if &sequal %tmp "S"
  55.                 set %KeywordType " data structure"
  56.             !else
  57.                 !if &sequal %tmp "M"
  58.                     set %KeywordType " utility macro"
  59.                 !else
  60.                     set %KeywordType " printer escape"
  61.                 !endif
  62.             !endif
  63.         !endif
  64.     !else
  65.     ; keyword contains lower case characters
  66.         set %KeywordType " function"
  67.     !endif
  68.     write-message &cat "Looking for: " &cat %Keyword %KeywordType
  69.     help-engine %sdk30hlp &cat %Keyword %KeywordType
  70. !endm
  71.  
  72. ; This macro calls up the Win 3.1 help on the curent topic
  73. store-procedure Win31-Help
  74.     run get-help-keyword
  75.     write-message &cat "Looking for: " &cat %Keyword
  76.     help-engine %sdk31hlp &cat %Keyword
  77. !endm
  78.  
  79. ; This macro calls up the Win32 help on the curent topic
  80. store-procedure Win32-Help
  81.     run get-help-keyword
  82.     write-message &cat "Looking for: " &cat %Keyword
  83.     help-engine %sdk32hlp &cat %Keyword
  84. !endm
  85.  
  86. ; This macro calls up the Turbo C for Windows help on the curent topic
  87. store-procedure TCW-Help
  88.     run get-help-keyword
  89.     write-message &cat "Looking for: " &cat %Keyword
  90.     help-engine %turbohlp &cat %Keyword
  91. !endm
  92.  
  93. ; add the SDK help menu items at position 5 in the Help menu
  94. ; ("@" positions start at 0)
  95. macro-to-menu   Win30-Help    ">&Help>Windows 3.&0 API@5"
  96. macro-to-menu   Win31-Help      "Windows 3.&1 API"
  97. macro-to-menu   Win32-Help      "Windows 3&2 API"
  98. macro-to-menu   TCW-Help        "&Turbo C++ help"
  99. ; follow by a separator (note that nop is used as a placeholder)
  100. bind-to-menu    nop             "-"
  101.  
  102. ;------------------------------------------------------
  103.  
  104. store-procedure run-makefile
  105.     find-screen "Results"
  106.     pipe-command %make
  107.     set $cbufname "Results"
  108. !endm
  109.  
  110. bind-to-menu nop ">E&xecute>-"
  111. macro-to-menu run-makefile "&Make"
  112.