/* REXX ------------------------------------------------------$$PROLOG*/ /* Program Name: RxHtmlQ */ /* Description: QA text for the RxHtml() function. */ /* Change log: Add new entries to the top */ /*-----------------Changed 20-MAY-2003 by: Bob Stark -----------------*/ /* 1. Initial coding */ /*--------------------------------------------------------------------*/ CALL ON ERROR NAME RXERROR SIGNAL ON SYNTAX NAME RXERROR SIGNAL ON NOVALUE NAME RXERROR TRACE N debug = '' rc = KWPARSE(ARG(1)) IF rc <> 0 THEN CALL ERRMSGX 'KWPARSE Failed, rc='rc IF debug <> '' THEN TRACE I IF WORDPOS(GETENV(),'CMDWNT') THEN DO PARSE UPPER SOURCE _src +3 . _type . IF _src = 'NT ' /* Where are we running? */ THEN environment = 'DOSENVIRONMENT' /* Automation Point REXX */ ELSE environment = 'ENVIRONMENT' /* IBM Object REXX */ tmp = VALUE('TMP',,environment) /* Get environment variable */ tempfile = tmp'\REX'RANDOM(9999)'.HTM' /* e.g. C:\TEMP\REX8259.HTM */ IF 1 THEN DO /* Example for the documentation... */ dwarf.1='Grumpy'; dwarf.2='Sleepy'; dwarf.3='Dopey'; dwarf.4='Doc'; dwarf.5='Happy'; dwarf.6='Bashful'; dwarf.7='Sneezy'; dwarf.0=7 rc=RxHtml('Head',"Title('Some Famous Dwarves') Output('web.')") rc=RxHtml('Body','BackColor(Blue) TextColor(Yellow) output(web.)') rc=RxHtml('List','Numbered(1) STEM(dwarf.) output(web.)') rc=RxHtml('Table','Output(web.) BACKCOLOR(Yellow) Colcolor(Blue)', 'COLALIGN(CENTER) Head1(Name) Col1Stem(dwarf.)') rc=RxHtml('Foot','output(web.)') END IF 0 THEN DO /* Nested tables... (this doesn't work) */ dwarf.1='Grumpy'; dwarf.2='Sleepy'; dwarf.3='Dopey'; dwarf.4='Doc'; dwarf.5='Happy'; dwarf.6='Bashful'; dwarf.7='Sneezy'; dwarf.0=7 rc=RxHtml('Table','BACKCOLOR(Yellow) Colcolor(Blue)', 'COLALIGN(CENTER) Head1(Name) Col1Stem(dwarf.)', 'Output(dwarfTbl.)') nav.1='www.ycs-online.com' nav.2='www.protechpts.com' nav.0=2 rc=RxHtml('Head',"Title('Nested Tables') Output('dwarfTbl.')") rc=RxHtml('Body','output(web.) BACKCOLOR(White)') rc=RxHtml('Table','Output(web.)', 'Col2Stem(nav.)', 'Col1Stem(dwarftbl.)') rc=RxHtml('Foot','output(web.)') END IF 0 THEN DO rc = RxHtml('Head',"Title('This tests the TITLE') Output('web.')") rc = RxHtml('Body','BackColor(Blue) TextColor(Yellow) output(web.)') web.0 = web.0 + 1 n = web.0 web.n = '
This is a paragraph>' dwarf.1 = 'Grumpy'; dwarf.2 = 'Sleepy'; dwarf.3 = 'Dopey' dwarf.4 = 'Bashful'; dwarf.5 = 'Happy'; dwarf.6 = 'Doc' dwarf.7 = 'Sneezy'; dwarf.0 = 7 a.1= 'My'; a.2 = 'Favorite'; a.3= 'Disney'; a.4 = 'Movie' a.5= 'is'; a.6 = 'Lady and the Tramp'; a.7=''; a.0 = 0 rc = RxHtml('FOO','TBLWIDTH(80%) BACKCOLOR(MAROON)') IF rc = 0 THEN SAY ' This should not have worked' ELSE SAY 'Test passed, rc='rc rc = RxHtml('Table','', 'COLCOLOR(LIME) COLALIGN(RIGHT)', 'COL1STEM(dwarf.) COL1COLOR(WHITE) HEAD1(Name)', 'COL1ALIGN(LEFT)', 'COL2STEM(a.) HEAD2(Stuff)', 'COL3STEM(dwarf.) COL3COLOR(BLACK) HEAD3(Quest)', 'COL3ALIGN(CENTER)', 'COL4STEM(dwarf.) COL4COLOR(UGLY) HEAD4(Foo)', 'COL5STEM(dwarf.) COL5COLOR(YELLOW) HEAD5(Foo)', 'COL6STEM(dwarf.) COL6COLOR(YELLOW) HEAD6(Foo)', 'COL7STEM(dwarf.) COL7COLOR(YELLOW) HEAD7(Foo)', 'COL8STEM(dwarf.) COL8COLOR(YELLOW) HEAD8(Foo)', 'COL9STEM(dwarf.) COL9COLOR(YELLOW) HEAD9(Foo)', 'RULES(NONE) FRAME(TOP)', 'output(web.)') SAY 'rc='rc rc = RxHtml('List','Bullet(disk) STEM(dwarf.) output(web.)') rc = RxHtml('List','Bullet(disk) STEM(dwarf.) output(web.)') rc = RxHtml('List','Bullet(circle) STEM(dwarf.) output(web.)') rc = RxHtml('List','Bullet(square) STEM(dwarf.) output(web.)') rc = RxHtml('List','Numbered(A) STEM(dwarf.) output(web.)') rc = RxHtml('List','Numbered(1) STEM(dwarf.) output(web.)') rc = RxHtml('List','Numbered(i) STEM(dwarf.) output(web.)') rc = RxHtml('List','Numbered(a) STEM(dwarf.) output(web.)') rc = RxHtml('List','Numbered(I) STEM(dwarf.) output(web.)') rc = RxHtml('Foot','output(web.)') END rc=IOWRITE('FILENAME('tempfile') STEM(web.)') ADDRESS CMD tempfile END EXIT: IF SYMBOL('max_rc') = 'LIT' THEN max_rc = 0 EXIT max_rc /*RXCOPY RXHTML NODUP 930 LINES COPIED ON 09-19-03 AT 11:08************/ /*Start of RxHtml() Function----------------------------Version-01.00-*/ /*:RxHtml Function: Generates HTML to display tables and lists, whose */ /* contents are passed into RxHtml are passed in via stem variables. */ /* Syntax: */ /* HEAD - define the HEAD section of a web page. The output will be */ /* issued as SAY commands (the default), but can be directed */ /* to the stack of saved in a stem variable): */ /* rc=RxHtml('Head',"Title('Text of page title') Output('stem.')") */ /* STACK */ /* SAY */ /* BODY - define the BODY section of a web page. Note that the */ /* following colors are supported: AQUA BLUE BLACK FUSHSIA */ /* GRAY GREEN LIME MAROON NAVY OLIVE PURPLE RED SILVER TEAL */ /* WHITE YELLOW: */ /* rc=RxHtml('Body','BackColor(color) TextColor(color)', */ /* 'LinkColor(color) VisitedLinkColor(color)', */ /* 'ActiveLinkColor(color) Output(dest)') */ /* */ /* LIST - define a LIST at the current portion of the web page. Note */ /* that STEM is required, and Bullet and Numbered are mutually */ /* exclusive: */ /* rc=RxHtml('List','STEM(input.stemVarName.) Output(dest)', */ /* 'BULLET(Disk | Circle | Square)', */ /* 'NUMBERED(A | 1 | a | i | I)') */ /* Lettered--^ ^ ^ */ /* Numbered------+ +------Roman Numerals */ /* */ /* TABLE - define a table at the current portion of the web page; */ /* data for the columns is provided by stem variables. */ /* rc=RxHtml('Table','Output(dest)', Output destination */ /* 'COLCOLOR(color)', Default text color */ /* 'BACKCOLOR(color)', Background color */ /* 'COLALIGN(LEFT|CENTER|RIGHT)', Default column */ /* Frame controls exterior grid lines... alignment */ /* 'FRAME(TOP|BOTTOM|LEFT|RIGHT|ALL|TOP,BOTTOM|LEFT,RIGHT)',*/ /* 'RULES(NONE|ROWS|COLS|ALL)', Interior grid lines*/ /* 'TBLWIDTH(nn%|nnn)', Table width % or pixels */ /* The following TABLE parms are for individual columns, col1-col12 */ /* 'COL1STEM(stem.)', Input stem variable for col1 */ /* 'COL1COLOR(color)', Text color for col1 */ /* 'HEAD1(Heading text)', optional Heading for col1*/ /* 'FOOT1(Footer text)', optional footer for col1 */ /* 'COL1ALIGN(LEFT|CENTER|RIGHT)', text alignment */ /* */ /* FOOT - Close off the bottom of the web page. */ /* */ /*Example: */ /* dwarf.1='Grumpy'; dwarf.2='Sleepy'; dwarf.3='Dopey'; dwarf.4='Doc';*/ /* dwarf.5='Happy'; dwarf.6='Bashful'; dwarf.7='Sneezy'; dwarf.0=7 */ /* rc=RxHtml('Head',"Title('Some Famous Dwarves') Output('web.')") */ /* rc=RxHtml('Body','BackColor(Blue) TextColor(Yellow) output(web.)') */ /* rc=RxHtml('List','Numbered(1) STEM(dwarf.) output(web.)') */ /* rc=RxHtml('Table','Output(web.) BACKCOLOR(Yellow) Colcolor(Blue)', */ /* 'COLALIGN(CENTER) Head1(Name) Col1Stem(dwarf.)' */ /* rc=RxHtml('Foot','output(web.)') */ /*--------------------------------------------------------------------*/ RxHtml: /* No expose here because caller passes stem vars by name. */ _htmerr = _HTMParse(ARG(1),ARG(2)) /* Parse incoming parameters */ IF _htmerr <> '' THEN RETURN _htmerr /* Return w/ error if parse fail*/ RETURN RxHtml1(ARG(1)) RxHtml1: PROCEDURE EXPOSE gbl. _htmp. _htm. (_htm.0expose) SELECT WHEN TRANSLATE(ARG(1)) = 'BODY' THEN DO _htmo = '
' rc=_htmo(_htmo) END WHEN TRANSLATE(ARG(1)) = 'FOOT' THEN DO rc=_htmo('') rc=_htmo('