home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 504a.lha / hypertext / Rexx / do_link.dme < prev    next >
Text File  |  1991-05-01  |  1KB  |  39 lines

  1. /* this is the *main* DME macro for use with HT */
  2.  
  3.  /* this line makes sure we get back a STRING from our main link macro */
  4. options results
  5.  
  6. address
  7.  /* this is where the *real* work is done (inside of link.rexx) */
  8. link_string = link.rexx()
  9.  
  10.  /* put back all options to defaults so as not to confuse DME */
  11. options
  12.  
  13.  /* if link_string is empty, user must have canceled requestor, so just
  14.   * exit outta here
  15.   */
  16. if link_string = "" then
  17.   exit
  18.  
  19. address
  20.  /* pop back to the original spot set when you pressed alt-s in DME */
  21.  /* then insert the link text                        */
  22. pong 8
  23. '(\\'link_string' )'
  24.  
  25.  /* now pop back to the final position.  However, things are different
  26.   * in the buffer now because we inserted that text above.  Therefore
  27.   * we need to go right that many spaces.  Then insert the \endlink
  28.   * keyword.
  29.   */
  30. pong 9
  31. do length(link_string)+1
  32.     /* ctrl-alt-shift-numeric keypad 6 is a magic macro for moving around */
  33.    "cas-nk6"
  34. end
  35.  
  36. /* insert the endlink command to finish up. */
  37. '(\\endlink )'
  38.  
  39.