home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
htmlkeys.zip
/
ClassEAs.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1997-08-29
|
6KB
|
232 lines
/* adds parameters to the EA's of a class*/
PARSE ARG File
CALL RxFuncAdd 'SysGetEA' , 'RexxUtil' , 'SysGetEA'
CALL RxFuncAdd 'SysPutEA' , 'RexxUtil' , 'SysPutEA'
NamEA=''
AliEa=''
AltEA=''
HspEA=''
VspEA=''
HiEa=''
WidEa=''
call SysGetEA File, 'HTMLKEYS_HEIGHT', 'EAval'
if length(EAval)>=4 then HiEa=right(EAval, length(EAval)-4)
call SysGetEA File, 'HTMLKEYS_WIDTH', 'EAval'
if length(EAval)>=4 then WidEa=right(EAval, length(EAval)-4)
call SysGetEA File, 'HTMLKEYS_NAME', 'EAval'
if length(EAval)>=4 then NamEa=right(EAval, length(EAval)-4)
call SysGetEA File, 'HTMLKEYS_ALIGN', 'EAval'
if length(EAval)>=4 then AliEa=right(EAval, length(EAval)-4)
call SysGetEA File, 'HTMLKEYS_ALT', 'EAval'
if length(EAval)>=4 then AltEa=right(EAval, length(EAval)-4)
call SysGetEA File, 'HTMLKEYS_HSPACE', 'EAval'
if length(EAval)>=4 then HspEa=right(EAval, length(EAval)-4)
call SysGetEA File, 'HTMLKEYS_VSPACE', 'EAval'
if length(EAval)>=4 then VspEa=right(EAval, length(EAval)-4)
call SysGetEA File, 'HTMLKEYS_PARAMETERS', 'paramEa'
Params.0=0
if c2d(left(paramEA,1))=253 then do
Params.0=1
Params.1=right(paramEA,length(paramEA)-4)
end /*if Do */
else do
if length(paramEA) <> 0 then do
paramEA=right(paramEA, length(paramEA)-4)
Params.0=c2d(left(paramEA, 1))
paramEA=right(paramEA, length(paramEA)-2)
y=1
do while y<= Params.0
paramEA=right(paramEA, length(paramEA)-2)
strlen=c2d(left(paramEA, 1))
paramEA=right(paramEA, length(paramEA)-2)
Params.y=left(paramEA, strlen)
paramEA=right(paramEA, length(paramEA)-strlen)
y=y+1
end /* y < Params.0 do */
end /*if Params length do*/
end /*else do*/
do while Command <> 'X'
if Command ='A' | Command='ADD' then do
inc=Params.0
ParamName=''
ParamValue=''
inc=inc+1
Param.inc=''
say 'Enter the Parameter Name'
PARSE PULL ParamName
if ParamName<>'' then do
say 'Enter the Parameter Value'
PARSE PULL ParamValue
end /*paramname do*/
if (ParamName<>'')&(ParamValue<>'') then do
Params.inc='NAME='ParamName' VALUE='ParamValue
end /* do */
Params.0=inc
end /* end add do*/
if Command='C' | Command='CHANGE' then do
say 'Which Line?'
newline=''
pull lineno
if (lineno <= Params.0)&(lineno>0) then do
say Params.lineno
say 'Enter the new Parameter Name'
parse pull ParamName
if ParamName<>'' then do
say 'Enter the new Parameter Value'
parse pull ParamValue
end /* do */
if (ParamName<>'')&(ParamValue<>'') then do
newline='NAME='ParamName' VALUE='ParamValue
end /* do */
if length(newline) <> 0 then Params.lineno = newline
end
end /* change Do */
if Command ='D' | Command='DEL' | Command='DELETE' then do
SAY 'Enter the number of the line you wish to delete'
PULL LineNo
inc=Params.0
inc=inc-1
Params.0 = inc
x=LineNo
do while x <= Params.0
y=x+1
Params.x=Params.y
x=x+1
end /* do */
end /* end Delete do*/
if Command ='S' | Command='SAVE' then do
paramEA='dfff0000'x
paramEA=paramEA||d2c(Params.0)||d2c(0)
x=1
do while x <= Params.0
paramEA=paramEA||'fdff'x||d2c(length(Params.x))||d2c(0)||Params.x
x=x+1
end /* do */
Call SysPutEA File, 'HTMLKEYS_PARAMETERS', paramEA
hob = length(widEA)%256
lob = length(widEA)-hob
EAval='fd'x||'ff'x||d2c(lob)||d2c(hob)||widEA
Call SysPutEA File, 'HTMLKEYS_WIDTH', EAval
hob = length(hiEA)%256
lob = length(hiEA)-hob
EAval='fd'x||'ff'x||d2c(lob)||d2c(hob)||hiEA
Call SysPutEA File, 'HTMLKEYS_HEIGHT', EAval
hob = length(HspEA)%256
lob = length(HspEA)-hob
EAval='fd'x||'ff'x||d2c(lob)||d2c(hob)||HspEA
Call SysPutEA File, 'HTMLKEYS_HSPACE', EAval
hob = length(VspEA)%256
lob = length(VspEA)-hob
EAval='fd'x||'ff'x||d2c(lob)||d2c(hob)||VspEA
Call SysPutEA File, 'HTMLKEYS_VSPACE', EAval
hob = length(NamEA)%256
lob = length(NamEA)-hob
EAval='fd'x||'ff'x||d2c(lob)||d2c(hob)||NamEA
Call SysPutEA File, 'HTMLKEYS_NAME', EAval
hob = length(AltEA)%256
lob = length(AltEA)-hob
EAval='fd'x||'ff'x||d2c(lob)||d2c(hob)||AltEA
Call SysPutEA File, 'HTMLKEYS_ALT', EAval
hob = length(AliEA)%256
lob = length(AliEA)-hob
EAval='fd'x||'ff'x||d2c(lob)||d2c(hob)||AliEA
Call SysPutEA File, 'HTMLKEYS_ALIGN', EAval
end /* end Save do*/
if Command ='W' then do
say 'Width='widEA
say 'Enter the width'
parse pull theWidth
widEA=theWidth
end /*w do*/
if Command ='H' then do
say 'Height='hiEA
say 'Enter the height'
parse pull theHeight
hiEA=theHeight
end /*w do*/
if Command ='HS' then do
say 'HSpace='HspEA
say 'Enter the H space'
parse pull theHeight
HspEA=theHeight
end /*w do*/
if Command ='VS' then do
say 'VSpace='VspEA
say 'Enter the V space'
parse pull theHeight
VspEA=theHeight
end /*w do*/
if Command ='ALT' then do
say 'ALT='AltEA
say 'Enter the Alternate text'
parse pull theHeight
AltEA=theHeight
end /*w do*/
if Command ='AL' then do
say 'ALIGN='AliEA
say 'Choose'
say '[L]eft [R]ight [T]op [M]iddle [B]ottom'
pull theHeight
if theHeight='L' then AliEa='LEFT'
else if theHeight = 'R' then AliEa = 'RIGHT'
else if theHeight = 'T' then AliEa = 'TOP'
else if theHeight = 'M' then AliEa = 'MIDDLE'
else if theHeight = 'B' then AliEa = 'BOTTOM'
else AliEa=''
end /*w do*/
if Command ='N' then do
say 'NAME='NamEA
say 'Enter the Name'
parse pull theHeight
NamEA=theHeight
end /*w do*/
say
say
say 'Name= 'NamEa||' Alt= 'AltEa
say 'Hspace= '||HspEa||' Vspace= '||VspEa||' Align= '||AliEA' Height= '||hiEa||' Width= '||widEa
say
x=1
do while x <= Params.0
say ' Parameter '||x||' 'Params.x
x=x+1
end /* do */
say
say
SAY 'What do you want to do next?'
say '[A]dd Parameter [C]hange Parameter [D]elete Parameter [S]ave e[x]it'
say 'Change the [H]eight [W]idth [HS]pace [VS]pace [N]ame [ALT]ernate text [AL]ign'
PULL Command
end /* do */