TSDRV = XDETSDRV()
TSPF = 0; TSPFL = " "; parse version name level date1 date2 date3
IF (name = "REXXSAA" & date3 = "1994") THEN TSPF = 0
IF (name = "REXX-r4") THEN TSPF = 1
IF (name = "REXXPC88" & date3 = "1987") THEN TSPF = 2
IF (name = "REXX/Personal" & date3 = "1992") THEN TSPF = 3
IF (name = "REXX/2" & date3 = "1995") THEN TSPF = 4
IF (name = "REXX/2" & date3 = "1996") THEN TSPF = 5
IF (name = "REXX-ooRexx_3.2.0(MT)") THEN TSPF = 6
IF (name = "REXX-Regina_3.7(MT)") THEN TSPF = 7
TSPFL = TSPF' 'name
IF (TSPF < 5 ) THEN TBROWSER = " IEXPLORE "
IF (TSPF > 4 ) THEN TBROWSER = " START c:\windows\system32\IEXPLORE.EXE "
THELP = TSDRV":\mnt\home\U\MHELP\"
TFILEOUT = TSDRV"c:\TEMP\DRET.HTM"
TBATCHIN = TSDRV"c:\TEMP\DRET.DAT"
IF (TSPF <> 4 & TSPF <> 5) THEN
DO
PARSE UPPER ARG EXNT PARMS
IF EXNT = "HTML" | EXNT = "HTM" | EXNT = "HTA" THEN PARMS = '<'PARMS
IF EXNT = "SPFSE" THEN DO
column = WORD(PARMS,1)
FULLNAME = WORD(PARMS,2)
EXNT = SUBSTR(FULLNAME,POS('.',FULLNAME)+1,3)
text = TRANSLATE(WORD(PARMS,3),' %<>|@"=',"Çüéâäàåç")
PARMS = TUNMASK(text, column)
END
END
IF (TSPF = 4 | TSPF = 5) THEN
DO
'ISREDIT MACRO(PARMS)'
IF WORDS(PARMS) = 1 & TRANSLATE(PARMS) = "H" THEN
DO
ERRLINE = "H3.SPF PARMS: H3 EXT KEYWORD H3 KEYWORD H3 PHP SUBSTR H3 HTM <TABLE"
'ISREDIT RESET'
"ISREDIT LINE_BEFORE " 1 "= NOTELINE '"ERRLINE"'"
"ISREDIT TOP"
EXIT
END
'ISREDIT (MODIFIED) = DATA_CHANGED'
IF (MODIFIED=YES) THEN
'ISREDIT SAVE'
'ISREDIT (FULLNAME) = MEMBER'
FULLNAME = TRANSLATE(FULLNAME)
EXNT = SUBSTR(FULLNAME,POS('.',FULLNAME)+1,3)
PARMS = TRANSLATE(PARMS)
IF WORDS(PARMS) = 1 THEN SIGNAL TJUMP
IF WORDS(PARMS) > 1 THEN
DO
EXNT = WORD(PARMS,1)
PARMS = WORD(PARMS,2)
SIGNAL TJUMP
END
NWRDS = WORDS(PARMS)
PASSED = ''
'isredit (line, column) = cursor'
'isredit (text) = line .zcsr'
'isredit (lrecl) = lrecl'
'isredit (cur_file) = member'
IF column = 0 THEN
NOP
ELSE DO
IF NWRDS = 0 THEN DO
PARMS = TUNMASK(text, column)
NWRDS = 3
END
END
END
TJUMP:
IF POS(EXNT,"ASM C WBT ZAS") > 0 THEN
DO
TTYPE = 1
TPRE = THELP
IF EXNT = 'ASM' THEN TFILEIN = TPRE'ASM'
IF EXNT = 'C' THEN TFILEIN = TPRE'C'
IF EXNT = 'WBT' THEN TFILEIN = TPRE'WB'
IF EXNT = 'ZBS' THEN TFILEIN = TPRE'ZB'
END
IF POS(EXNT,"ADS REX CMD SPF ISP PBW LBS COB CBL PBS DL6 ") > 0 THEN
DO
TTYPE = 2
TPRE = THELP
IF EXNT = "ADS" THEN TFILEIN = TPRE'ADS'
IF EXNT = 'PBW' THEN TFILEIN = TPRE'PBWIN'
IF EXNT = 'REX' THEN TFILEIN = TPRE'OOREXX'
IF EXNT = 'CMD' THEN TFILEIN = TPRE'REXXC'
IF EXNT = 'SPF' THEN TFILEIN = TPRE'SPFPRO'
IF EXNT = 'ISP' THEN TFILEIN = TPRE'SPFPRO'
IF EXNT = 'LBS' THEN TFILEIN = TPRE'LB'
IF EXNT = 'COB' THEN TFILEIN = TPRE'COBOL'
IF EXNT = 'CBL' THEN TFILEIN = TPRE'COBOL'
IF EXNT = 'PBS' THEN TFILEIN = TPRE'PBS'
IF EXNT = 'DL6' THEN TFILEIN = TPRE'PBCC5'
END
IF POS(EXNT," HTA HTM HTML PHP CSS JAVA WINREF VBS FBS BAS") > 0 THEN
DO
TTYPE = 3
TPRE = THELP
IF EXNT = 'PHP' THEN TFILEIN = TPRE'PHP'
IF EXNT = 'HTA' THEN TFILEIN = TPRE'HTML40'
IF EXNT = 'HTM' THEN TFILEIN = TPRE'HTML40'
IF EXNT = 'HTML' THEN TFILEIN = TPRE'HTML40'
IF EXNT = 'CSS' THEN TFILEIN = TPRE'CSS2'
IF EXNT = 'JAVA' THEN TFILEIN = TPRE'JAVA'
IF EXNT = 'WINREF' THEN TFILEIN = TPRE'WINREF'
IF EXNT = 'VBS' THEN TFILEIN = TPRE'VBS'
IF EXNT = 'FBS' THEN TFILEIN = TPRE'FBASIC'
IF EXNT = 'BAS' THEN TFILEIN = TPRE'FBASIC'
END
IF (POS(EXNT,"SPF ISP") > 0 & TSPF = 5) THEN
DO
ADDRESS ISREDIT TSDRV':\mnt\home\U\SPFPRO\REXX\SPF5HELP.ISP 'PARMS
EXIT 0
END
IF EXNT = "PBC" | EXNT = "INC" THEN
DO
PARMS = "> "TRANSLATE(PARMS)" "
IF EXNT = "PBC" THEN
DO
TRAWHTML = TSDRV':\mnt\home\U\PBC\BIN\PBC.HTM'
T = TRANSLATE(LINEIN(TRAWHTML),1)
DO WHILE LINES(TRAWHTML) > 0
IF POS(PARMS, T, 1) > 0 THEN
DO
SP = POS('<A HREF="..',T)
TR = SUBSTR(T,SP+12)
EP = POS('"',TR,1)
TR = SUBSTR(TR,1,EP-1)
T = LINEOUT(TRAWHTML)
TCMD = TBROWSER" mk:@MSITStore:"TSDRV":mnt\home\U\PBC\bin\PBCC.chm::/"TR
CALL TOSCMD TSPF, TCMD
EXIT 0
END
T = TRANSLATE(LINEIN(TRAWHTML))
END
END
EXIT 0
END
DO WHILE LINES(TFILEIN'.BDX') > 0
T = LINEIN(TFILEIN'.BDX')
IF (TTYPE = 1 & (TSPF = 4 | TSPF = 5)) THEN
DO
IF PARMS = WORD(T,4) THEN
DO
DATALINE = SUBSTR(T,24)
CALL FIXQUOTES
T = LINEOUT(TFILEIN'.BDX')
EXIT 0
END
END
IF TTYPE = 2 THEN
DO
IF PARMS = TRANSLATE(WORD(T,1)) THEN
DO
TCMD = TBROWSER' 'WORD(T,2)
T = LINEOUT(TFILEIN'.BDX')
CALL RDOS TSPF, TCMD
EXIT 0
END
END
IF TTYPE = 3 THEN
DO
IF PARMS = TRANSLATE(WORD(T,1)) THEN DO
IF POS(EXNT,"BAS FBS",1) > 0 THEN DO
IF LEFT(WORD(T,2),1) = "*" THEN
TCMD = TBROWSER" C:\U\CODE\FBASIC\HTML\"WORD(T,1)".HTM"
ELSE
TCMD = TBROWSER" mk:@MSITStore:"THELP''WORD(T,2)
CALL RDOS TSPF, TCMD
EXIT 0
END
IF POS(EXNT, " HTA HTM HTML",1) > 0 THEN DO
IF WORD(T,2) = "*CSS" THEN DO
TV = STRIP(TRANSLATE(WORD(T,1)," ",":"),"B"," ")
CSS = TSDRV':\mnt\home\U\MHELP\CSS\CSS\en\css\reference\'TV'\index.html'
TCMD = TBROWSER" "CSS
CALL RDOS TSPF, TCMD
EXIT 0
END
IF TRANSLATE(LEFT(WORD(T,2),4)) = TSDRV":\U" THEN DO
IF WORD(T,2) = "*CSS" THEN DO
TV = TRANSLATE(WORD(T,1)," ",":")
CSS = TSDRV':\mnt\home\U\MHELP\CSS\CSS\en\css\reference\'TT'\index.html'
END
TCMD = TBROWSER" "WORD(T,2)
CALL RDOS TSPF, TCMD
EXIT 0
END
END
TCMD = TBROWSER" mk:@MSITStore:"THELP''WORD(T,2)
CALL RDOS TSPF, TCMD
EXIT 0
END
END
END
EXIT 0
TUNMASK: PROCEDURE
PARSE ARG text, column
IF POS(".",text,1) > 0 THEN DO
SP = 1
TLEN = LENGTH(text)
DO WHILE SP < TLEN
S = POS(".",text,SP)
IF S = 0 THEN LEAVE
IF S > 0 THEN DO
TL = SUBSTR(text,1,S-1)
TR = SUBSTR(text,S+1)
text = TL' .'TR
SP = S + 3
END
END
END
TableYes = '_\:*?<#$.-' || XRANGE('0','9') || XRANGE('A','Z') || XRANGE('a','z')
TableNo = TRANSLATE(XRANGE(D2C(32),D2C(255)),,TableYes,' ')
wordmask = TRANSLATE(text,,TableNo, ' ')
wordmask = TRANSLATE(wordmask,,TableYes,'*')
n = 1
Wi = 0
Wn = 0
DO FOREVER;
i = WORDINDEX(wordmask,n)
IF (i = 0) THEN LEAVE
IF (i <= column) THEN DO
Wi = i
Wn = n
END
ELSE
LEAVE
n = n+1
END
Wm = WORD(wordmask,Wn)
TL = LENGTH(Wm)
WFile = SUBSTR(text,Wi,TL)
PARMS = TRANSLATE(WFile)
PARMS = STRIP(PARMS)
RETURN (PARMS)
TOSCMD: PROCEDURE
PARSE ARG TSPF, TCMD
IF TSPF = 0 THEN ADDRESS COMMAND TCMD ;
IF (TSPF = 4) THEN ADDRESS COMMAND TCMD ;
IF (TSPF = 5 ) THEN ADDRESS SYSTEM TCMD ;
IF (TSPF = 1 | TSPF = 6) THEN TCMD ;
IF TSPF = 7 THEN ADDRESS SYSTEM TCMD ;
RETURN
FIXQUOTES:
ERRLINE = TRANSLATE(DATALINE,"~","'")
ERRLINE = TRANSLATE(ERRLINE,'~','"')
"ISREDIT LINE_BEFORE " line "= NOTELINE '"ERRLINE"'"
RETURN
XDETSDRV: PROCEDURE
PARSE SOURCE ENV TYPE NAME
TSDRV = LEFT(NAME,1,1)
RETURN (TSDRV)
RDOS: PROCEDURE
PARSE ARG TSPF, CMD
TBAT = "C:\TEMP\RDOS.BAT"
T = LINEOUT(TBAT,"@ECHO OFF",1)
TCNT = XWORDS(CMD,";")
DO CNT = 1 TO TCNT
TCMD = XWORD(CMD,CNT,";")
T = LINEOUT(TBAT,TCMD)
END
T = LINEOUT(TBAT,'EXIT')
T = LINEOUT(TBAT)
IF (TSPF = 5 | TSPF = 7) THEN ADDRESS SYSTEM TBAT
IF (TSPF = 1 | TSPF = 6) THEN TBAT
IF (TSPF = 0 | TSPF = 4) THEN ADDRESS COMMAND TBAT
RETURN
XWORDS: PROCEDURE
PARSE ARG X, XDL
X = XLATE(X,XDL)
NWRDS = WORDS(X)
RETURN (NWRDS)
XWORD: PROCEDURE
PARSE ARG X, N ,XDL
IF N > XWORDS(X,XDL) THEN RETURN ("")
X = XLATE(X,XDL)
X = WORD(X,N)
X = XUNLATE(X)
RETURN (X)
XLATE: PROCEDURE
PARSE ARG X, XDL
X = TRANSLATE(X,D2C(253)," ")
X = TRANSLATE(X," ",XDL)
RETURN (X)
XUNLATE: PROCEDURE
PARSE ARG X
X = TRANSLATE(X," ",D2C(253))
RETURN (X)
XTRIML: PROCEDURE
PARSE ARG X, N
IF LENGTH(X) - 1 >= N THEN
XR = RIGHT(X,LENGTH(X) - N)
ELSE
XR = X
RETURN (XR)