/*
** html_anchor.ced
**
** $VER: html_anchor.ced 2.1 (02.03.1999)
**
** Arexx script for HTML v3.2 anchor mark
**
** This script works with CygnusEd Professional v4.2
**
** Copyright © Eric BELLE
*/
/*
**------------------------------------------------------------------------------
** Initialisation
**------------------------------------------------------------------------------
*/
OPTIONS RESULTS /* Tell CygnusEd to return results. */
NL = '0A'X /* Alias for new line. */
KRETURN = RAWKEY 68 /* Shortcut to the return key. */
KTAB = RAWKEY 66 /* Shortcut to the tab key. */
STATUS TABSARESPACES /* Return TAB mode ("tab" or "space"). */
IF RESULT = 1 /* Test the TAB mode. */
THEN "TABS = SPACES" /* Switch TAB mode from "space" to "tab". */
ELSE NOP /* No operation. */
TAB SIZE 1 /* Set TAB size proportional to 2 spaces. */
/*
**------------------------------------------------------------------------------
** Anchor identification name
**------------------------------------------------------------------------------
*/
GETSTRING '"Anchor"' '"Indentification name for the anchor?"'
AnchorName= RESULT
IF (AnchorName=" " | AnchorName="RESULT")
THEN EXIT 0
ELSE NOP
/*
**------------------------------------------------------------------------------
** Anchor mode
**------------------------------------------------------------------------------
*/
AnchorMode = "q"
DO WHILE ~(AnchorMode="t" | AnchorMode="i",
| AnchorMode=" " | AnchorMode="RESULT")
GETSTRING "t" '"Anchor mode: (t)ext, (i)mage?"'
AnchorMode = RESULT
END
SELECT
WHEN (AnchorMode="RESULT") THEN EXIT 0
WHEN (AnchorMode=" ") THEN EXIT 0
WHEN (AnchorMode="i") THEN DO
/*
**------------------------------------------------------------------------------
** Image anchor name
**------------------------------------------------------------------------------
*/
ImageLocation = "q"
DO WHILE ~(ImageLocation="l" | ImageLocation="a" | ImageLocation="u",
| ImageLocation=" " | ImageLocation="RESULT")
GETSTRING "l" '"Image location: (l)ocal, (a)bsolute, (u)niversal?"'
ImageLocation = RESULT
END
IF (ImageLocation="RESULT" | ImageLocation=" ")
THEN EXIT 0
ELSE NOP
SELECT
WHEN (ImageLocation="l") THEN DO
GETSTRING "Image" '"Image name with its relative path?"'
ImageName = RESULT
IF (ImageName=" " | ImageName="RESULT")
THEN EXIT 0
ELSE NOP
OpenImage = '"
END
OTHERWISE NOP
END
/*
**------------------------------------------------------------------------------
** HTML anchor structure
**------------------------------------------------------------------------------
*/
OpenAnchor = ''
CloseAnchor = ""
/*
**------------------------------------------------------------------------------
** Anchor structure
**------------------------------------------------------------------------------
*/
TEXT OpenAnchor ; "AUTO-INDENT" ; KTAB
IF (AnchorMode="t")
THEN TEXT "Should be modified - Anchor text"
ELSE DO
IF (ImagepositionMode="c")
THEN DO
TEXT "