/* ** html_table.ced ** ** $VER: html_table.ced 1.3 (12.20.1998) ** ** Arexx script for HTML v3.2 table options ** ** 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. */ /* **------------------------------------------------------------------------------ ** Line number **------------------------------------------------------------------------------ */ GETNUMBER 2 '"Line number?"' 1 32768 LineNumber = RESULT IF (LineNumber=" ") THEN EXIT 0 ELSE NOP /* **------------------------------------------------------------------------------ ** Column number **------------------------------------------------------------------------------ */ GETNUMBER 2 '"Column number?"' 1 32768 ColumnNumber = RESULT IF (ColumnNumber=" ") THEN EXIT 0 ELSE NOP /* **------------------------------------------------------------------------------ ** Table size options **------------------------------------------------------------------------------ */ TableSize = "q" DO WHILE ~(TableSize="y" | TableSize="n" | TableSize="d", | TableSize=" " | TableSize="RESULT") GETSTRING "d" '"Table size options: (y)es, (n)o, (d)efault?"' TableSize = RESULT END IF (TableSize="RESULT" | TableSize=" ") THEN EXIT 0 ELSE NOP SELECT WHEN (TableSize="d") THEN DO BorderSize = "5" SquaringSize = "5" TableWidth = "100%" TableHeight = "100%" CellPadding = "10" END WHEN (TableSize="y") THEN DO GETNUMBER 5 '"Border size?"' 0 32768 BorderSize = RESULT IF (BorderSize=" ") THEN EXIT 0 ELSE NOP GETNUMBER 5 '"Squaring size?"' 0 32768 SquaringSize = RESULT IF (SquaringSize=" ") THEN EXIT 0 ELSE NOP GETSTRING "100%" '"Table width (pixels or browser window %)?"' TableWidth = RESULT IF (TableWidth="RESULT" | TableWidth=" ") THEN EXIT 0 ELSE NOP GETSTRING "100%" '"Table height (pixels or browser window %)?"' TableHeight = RESULT IF (TableHeight="RESULT" | TableHeight=" ") THEN EXIT 0 ELSE NOP GETSTRING "10" '"Pixels between cell border and contents?"' CellPadding = RESULT IF (Cell padding="RESULT" | CellPadding=" ") THEN EXIT 0 ELSE NOP END OTHERWISE NOP END /* **------------------------------------------------------------------------------ ** Table color options **------------------------------------------------------------------------------ */ TableColor = "q" DO WHILE ~(TableColor="y" | TableColor="n" | TableColor="d", | TableColor=" " | TableColor="RESULT") GETSTRING "d" '"Table color options: (y)es, (n)o, (d)efault?"' TableColor = RESULT END IF (TableColor="RESULT" | TableColor=" ") THEN EXIT 0 ELSE NOP SELECT WHEN (TableColor="d") THEN DO BackgroundColor = "#808080" BorderColor = "#FFFFFF" BorderColorDark = "#303030" BorderColorLight = "#B0B0B0" END WHEN (TableColor="y") THEN DO GETSTRING "#808080" '"Background color (#RGB)?"' BackgroundColor = RESULT IF (BackgroundColor="RESULT" | BackgroundColor=" ") THEN EXIT 0 ELSE NOP GETSTRING "#FFFFFF" '"Border color (#RGB)?"' BorderColor = RESULT IF (BorderColor="RESULT" | BorderColor=" ") THEN EXIT 0 ELSE NOP GETSTRING "#303030" '"Border color for bottom shade (#RGB)?"' BorderColorDark = RESULT IF (BorderColorDark="RESULT" | BorderColorDark=" ") THEN EXIT 0 ELSE NOP GETSTRING "#B0B0B0" '"Border color for top shade (#RGB)?"' BorderColorLight = RESULT IF (BorderColorLight="RESULT" | BorderColorLight=" ") THEN EXIT 0 ELSE NOP END OTHERWISE NOP END /* **------------------------------------------------------------------------------ ** Table caption **------------------------------------------------------------------------------ */ CaptionMode = "q" DO WHILE ~(CaptionMode="t" | CaptionMode="b" | CaptionMode="n", | CaptionMode=" " | CaptionMode="RESULT") GETSTRING "n" '"Caption type: (t)op, (b)ottom, (n)othing?"' CaptionMode = RESULT END IF (CaptionMode="RESULT" | CaptionMode=" ") THEN EXIT 0 ELSE NOP IF (CaptionMode="n") THEN NOP ELSE DO CaptionPositionMode = "q" DO WHILE ~(CaptionPositionMode="l" | CaptionPositionMode="c", | CaptionPositionMode="r", | CaptionPositionMode=" " | CaptionPositionMode="RESULT") GETSTRING "c" '"Caption position: (l)eft, (c)enter, (r)ight?"' CaptionPositionMode = RESULT END IF (CaptionPositionMode="RESULT" | CaptionPositionMode=" ") THEN EXIT 0 ELSE NOP END /* **------------------------------------------------------------------------------ ** Cell Mode **------------------------------------------------------------------------------ */ CellMode = "q" DO WHILE ~(CellMode="l" | CellMode="r" | CellMode="t" | CellMode="b", | CellMode="n" | CellMode=" " | CellMode="RESULT") GETSTRING "l" '"Main cells: (l)eft, (r)ight, (t)op, (b)ottom, (n)o?"' CellMode = RESULT END IF (CellMode="RESULT" | CellMode=" ") THEN EXIT 0 ELSE NOP /* **------------------------------------------------------------------------------ ** Html table marks **------------------------------------------------------------------------------ */ IF (TableSize="n") THEN TableSizeString = "" ELSE DO TableSizeString = " BORDER=" || BorderSize TableSizeString = TableSizeString || " CELLSPACING=" || SquaringSize TableSizeString = TableSizeString || " WIDTH=" || TableWidth TableSizeString = TableSizeString || " HEIGHT=" || TableHeight TableSizeString = TableSizeString || " CELLPADDING=" || CellPadding END IF (TableColor="n") THEN TableColorString = "" ELSE DO TableColorString = " BGCOLOR=" || BackgroundColor TableColorString = TableColorString || " BORDERCOLOR=" || BorderColor TableColorString = TableColorString || " BORDERCOLORDARK=" || BorderColorDark TableColorString = TableColorString || " BORDERCOLORLIGHT=" || BorderColorLight END OpenTable = "