home *** CD-ROM | disk | FTP | other *** search
- /* HTML-Helper Arexx script for Write
- * Ver : 1.1 (7th January 1996)
- * Copyright: Paul Kolenbrander (InterNet: paul@serena.iaehv.nl)
- * Function : Pass on the HTML commands from HTML-Helper to Write.
- * Detect if block is selected and if so drape tag pairs
- * around the block and then deselect it.
- * Input : HTMLCMD - The HTML command to be inserted.
- */
-
- OPTIONS RESULTS /* enable return codes */
- PARSE ARG MYCMD HTMLCMD
- HTMLCMD = SUBSTR(HTMLCMD,2, LENGTH(HTMLCMD)-1) /* strip leading space */
-
- /* HTMLCMD = STRIP((TRANSLATE(HTMLCMD,'','\')), B,'"') */
- /* Strip quotes at each end. */
-
- ADDRESS "WRITE" /* Default, edit if needed */
-
- 'GetVar (_Marked)' /* Check if block is defined */
- Blok = Result
- IF Blok = 2 THEN DO
- /* A block is defined */
- 'GetVar (_MarkAy)'
- BeginLine = Result /* Now get the block coords. */
- 'GetVar (_MarkAx)'
- BeginCol = Result
- 'GetVar (_MarkBy)'
- EndLine = Result
- 'GetVar (_MarkBx)'
- EndCol = Result
- IF POS('><',HTMLCMD) ~= 0 THEN DO /* Is it a split command? */
- /* If yes, then.... */
- CMD2 = right(HTMLCMD,(LENGTH(HTMLCMD)-(LASTPOS('<',HTMLCMD))+1))
- CMD1 = substr(HTMLCMD,1,(LENGTH(HTMLCMD)-LENGTH(CMD2)))
- CMD1 = CMD1||'"'
- CMD2 = '"'||CMD2
- say CMD1 CMD2
- 'GOTO' EndCol EndLine /* Move to end and put 2nd */
- 'WriteText' CMD2
- 'GOTO' BeginCol BeginLine /* Move to start and put 1st */
- 'WriteText' CMD1
- END
- ELSE DO
- 'WriteText' HTMLCMD /* Insert at current pos. */
- END
- END
- ELSE DO
- 'WriteText' HTMLCMD /* Insert at current pos. */
- END
-
- IF MYCMD = 'SAVE' THEN DO
- 'Save _FileName'
- 'GetVar (_FileName)'
- IF RESULT = -1 THEN DO
- ADDRESS COMMAND 'rx S:HTMLVIEW.rexx'
- END
- ELSE DO
- ADDRESS COMMAND 'rx S:HTMLVIEW.rexx '||RESULT
- END
- END
-
- EXIT /* And exit the script. */
-