home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Spezial
/
SPEZIAL2_97.zip
/
SPEZIAL2_97.iso
/
ANWEND
/
ONLINE
/
SREFV12J
/
USETABL2.RX0
< prev
next >
Wrap
Text File
|
1996-12-23
|
4KB
|
100 lines
/* this is the USETABL2 Rexx-code block, to be called as a
file using the INTERPRET FILE USETABL2.RXX keyphrase.
To use this:
1) Create an html document. Without loss of generality,
let's call it TABLEDO.HTM
1) Insert the following SSI keyphrase into TABLEDO.HTM,
at the position you want a table inserted
<!-- Interpret file usetabl2.rxx -->
2) Create two files:
TABLEDO.TBL -- the HTML table you want inserted
TABLEDO.DEF -- a text version of this table
3) Make sure that TABLEDO.HTM, TABLEDO.TBL, and TABLEDO.DEF
are in the same directory
4) That's it-- just put a link to TABLEDO.HTM, and the rest
is automatic.
Note that when USETABL2 can not find out for sure if the browser
supports tables, it will send back a little note asking the
client to select YES or NO; and then resend the apporpriate
version.
Note:
This procedure uses the SREF_BROWSER_INFO macrospace routine, which
uses the BROWSERS.IDX file (which should be in your
WORKDATA_DIR directory).
See SREFPRC1.DOC for information on SREF_BROWSER_INFO
Citation: the browser capabilities list was obtained from
http://www.openmarket.com/browsertest/prob/bt-maker.cgi
*/
seldoc=docname
isat=lastpos('.',docname);
docname0=docname ;
if isat>0 then
docname0=delstr(docname,isat) ;
docname1=0 ;
if symbol('optlist.0')='VAR' then do ;
do tmp1z=1 to optlist.0;
parse upper var optlist.tmp1z tmp.1 '=' tmp.2;
if tmp.1="TABLE" & tmp.2="YES" then do;
docname1=docname0||'.TBL' ; leave ; end;
if tmp.1="TABLE" & tmp.2="NO" then do ;
docname1=docname0||'.DEF' ; leave ; end ;
end;
end ;
dotabl=upper(sref_browser_Info('TABLES'))
if docname1=0 then do ;
if dotabl='YES' then do
docname1=docname0||'.TBL' ;
end ;
end;
if docname1=0 then do ;
if dotabl='NO' then do
docname1=docname0||'.DEF' ;
end;
end;
delim_1.1=get_value('DELIM_1.1')
delim_2.1=get_value('DELIM_2.1')
IF DOCNAME1<>0 THEN do ;
interpret.results=delim_1.1||'INCLUDE '||docname1||delim_2.1 ;
END ;
else do ;
aac='?';
if pos('?',seldoc)>0 then aac="&" ;
themess="" ;
putme=reqfield("User-Agent");
tmp.1="<html><head><title> Table Version Check </title></head> <body> " ;
tmp.2=" <h2> The requested document contains an optional table </h2> ";
tmp.3=" <br> and our server can't tell whether your browser supports table! ";
tmp.4=" <p> <em> Please select either ..</em> <blockquote>" ;
tmp.5='<p> the <a href="/'||seldoc||aac||'TABLE=YES"> .. TABLE version </a>' ;
tmp.6='<p> or the <a href="/'||seldoc||aac||'TABLE=NO"> .. non-table version </a>' ;
tmp.7='</blockquote> of the requested document: ' docname;
tmp.8='<p> Hint: if you see a little table below... your browser <strong>can</strong> handle tables! ' ;
tmp.9="<table border=1><th>Headings <th>Col 1 <th> col 2<th> col 3 " ;
tmp.10="<tr> <td> Row is.. </td> <td> r1 c1 </td <td> r1 c2 </td> ";
tmp.11='<td> r1 c2 </td> <td> last spot </td> </table> ' ;
tmp.12='<hr> FYI: Your browser claims to be :<em>' putme '</em>';
tmp.13="</body></html> ";
themess=tmp.1;
do tmpi=2 to 13 ;
themess=themess||tmp.tmpi ;
end ;
'var type text/html as ' docname ' NAME themess ' ;
return 1
end ;