home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / htmlks10.zip / ClassEA.cmd < prev    next >
OS/2 REXX Batch file  |  1997-09-10  |  6KB  |  232 lines

  1. /* adds parameters to the EA's of a class*/
  2. PARSE ARG File
  3. CALL RxFuncAdd 'SysGetEA' , 'RexxUtil' , 'SysGetEA'
  4. CALL RxFuncAdd 'SysPutEA' , 'RexxUtil' , 'SysPutEA'
  5. say File
  6.  
  7. NamEA=''
  8. AliEa=''
  9. AltEA=''
  10. HspEA=''
  11. VspEA=''
  12. HiEa=''
  13. WidEa=''
  14. call SysGetEA File, 'HTMLKEYS_HEIGHT', 'EAval'
  15. if length(EAval)>=4 then HiEa=right(EAval, length(EAval)-4)
  16. call SysGetEA File, 'HTMLKEYS_WIDTH', 'EAval'
  17. if length(EAval)>=4 then WidEa=right(EAval, length(EAval)-4)
  18. call SysGetEA File, 'HTMLKEYS_NAME', 'EAval'
  19. if length(EAval)>=4 then NamEa=right(EAval, length(EAval)-4)
  20. call SysGetEA File, 'HTMLKEYS_ALIGN', 'EAval'
  21. if length(EAval)>=4 then AliEa=right(EAval, length(EAval)-4)
  22. call SysGetEA File, 'HTMLKEYS_ALT', 'EAval'
  23. if length(EAval)>=4 then AltEa=right(EAval, length(EAval)-4)
  24. call SysGetEA File, 'HTMLKEYS_HSPACE', 'EAval'
  25. if length(EAval)>=4 then HspEa=right(EAval, length(EAval)-4)
  26. call SysGetEA File, 'HTMLKEYS_VSPACE', 'EAval'
  27. if length(EAval)>=4 then VspEa=right(EAval, length(EAval)-4)
  28.  
  29.  
  30.  
  31. call SysGetEA File, 'HTMLKEYS_PARAMETERS', 'paramEa'
  32. Params.0=0
  33. if c2d(left(paramEA,1))=253 then do
  34. Params.0=1
  35. Params.1=right(paramEA,length(paramEA)-4)
  36.  
  37.  
  38.  
  39.  
  40. end  /*if Do */
  41. else do
  42.      if length(paramEA) <> 0 then do
  43.           paramEA=right(paramEA, length(paramEA)-4)
  44.           Params.0=c2d(left(paramEA, 1))
  45.           paramEA=right(paramEA, length(paramEA)-2)
  46.           y=1
  47.           do while y<= Params.0
  48.                paramEA=right(paramEA, length(paramEA)-2)
  49.                strlen=c2d(left(paramEA, 1))
  50.                paramEA=right(paramEA, length(paramEA)-2)
  51.                Params.y=left(paramEA, strlen)
  52.                paramEA=right(paramEA, length(paramEA)-strlen)
  53.                y=y+1
  54.           end /* y < Params.0 do */
  55.      end /*if Params length do*/
  56. end /*else do*/
  57.  
  58. do while Command <> 'X'
  59.  
  60. if Command ='A' | Command='ADD' then do
  61.     inc=Params.0
  62.     ParamName=''
  63.     ParamValue=''
  64.     inc=inc+1
  65.     Param.inc=''
  66.     say 'Enter the Parameter Name'
  67.     PARSE PULL ParamName
  68.     if ParamName<>'' then do
  69.         say 'Enter the Parameter Value'
  70.         PARSE PULL ParamValue
  71.     end /*paramname do*/
  72.     if (ParamName<>'')&(ParamValue<>'') then do
  73.         Params.inc='NAME='ParamName' VALUE='ParamValue
  74.     end /* do */
  75.     Params.0=inc
  76. end /* end add do*/
  77.  
  78.  
  79. if Command='C' | Command='CHANGE' then do
  80.     say 'Which Line?'
  81.     newline=''
  82.     pull lineno
  83.     if (lineno <= Params.0)&(lineno>0) then do
  84.         say Params.lineno
  85.         say 'Enter the new Parameter Name'
  86.         parse pull ParamName
  87.         if ParamName<>'' then do
  88.             say 'Enter the new Parameter Value'
  89.             parse pull ParamValue
  90.         end /* do */
  91.         if (ParamName<>'')&(ParamValue<>'') then do
  92.             newline='NAME='ParamName' VALUE='ParamValue
  93.         end /* do */
  94.         if  length(newline) <> 0 then Params.lineno = newline
  95.     end
  96. end  /* change Do */
  97.  
  98.  
  99.  
  100. if Command ='D' | Command='DEL' | Command='DELETE' then do
  101.     SAY 'Enter the number of the line you wish to delete'
  102.     PULL LineNo
  103.     inc=Params.0
  104.     inc=inc-1
  105.     Params.0 = inc
  106.         x=LineNo
  107.     do while x <= Params.0
  108.         y=x+1
  109.         Params.x=Params.y
  110.         x=x+1
  111.     end /* do */
  112.  
  113. end /* end Delete do*/
  114.  
  115.  
  116. if Command ='S' | Command='SAVE' then do
  117.     paramEA='dfff0000'x
  118.     paramEA=paramEA||d2c(Params.0)||d2c(0)
  119.     x=1
  120.     do while x <= Params.0
  121.         paramEA=paramEA||'fdff'x||d2c(length(Params.x))||d2c(0)||Params.x
  122.         x=x+1
  123.     end /* do */
  124.     Call SysPutEA File, 'HTMLKEYS_PARAMETERS', paramEA
  125.     hob = length(widEA)%256
  126.     lob = length(widEA)-hob
  127.     EAval='fd'x||'ff'x||d2c(lob)||d2c(hob)||widEA
  128.     Call SysPutEA File, 'HTMLKEYS_WIDTH', EAval
  129.     hob = length(hiEA)%256
  130.     lob = length(hiEA)-hob
  131.     EAval='fd'x||'ff'x||d2c(lob)||d2c(hob)||hiEA
  132.     Call SysPutEA File, 'HTMLKEYS_HEIGHT', EAval
  133.     hob = length(HspEA)%256
  134.     lob = length(HspEA)-hob
  135.     EAval='fd'x||'ff'x||d2c(lob)||d2c(hob)||HspEA
  136.     Call SysPutEA File, 'HTMLKEYS_HSPACE', EAval
  137.     hob = length(VspEA)%256
  138.     lob = length(VspEA)-hob
  139.     EAval='fd'x||'ff'x||d2c(lob)||d2c(hob)||VspEA
  140.     Call SysPutEA File, 'HTMLKEYS_VSPACE', EAval
  141.     hob = length(NamEA)%256
  142.     lob = length(NamEA)-hob
  143.     EAval='fd'x||'ff'x||d2c(lob)||d2c(hob)||NamEA
  144.     Call SysPutEA File, 'HTMLKEYS_NAME', EAval
  145.     hob = length(AltEA)%256
  146.     lob = length(AltEA)-hob
  147.     EAval='fd'x||'ff'x||d2c(lob)||d2c(hob)||AltEA
  148.     Call SysPutEA File, 'HTMLKEYS_ALT', EAval
  149.     hob = length(AliEA)%256
  150.     lob = length(AliEA)-hob
  151.     EAval='fd'x||'ff'x||d2c(lob)||d2c(hob)||AliEA
  152.     Call SysPutEA File, 'HTMLKEYS_ALIGN', EAval
  153.  
  154. end /* end Save do*/
  155.  
  156.  
  157. if Command ='W' then do
  158.     say 'Width='widEA
  159.     say 'Enter the width'
  160.     parse pull theWidth
  161.     widEA=theWidth
  162. end /*w do*/
  163.  
  164. if Command ='H' then do
  165.     say 'Height='hiEA
  166.     say 'Enter the height'
  167.     parse pull theHeight
  168.     hiEA=theHeight
  169. end /*w do*/
  170.  
  171. if Command ='HS' then do
  172.     say 'HSpace='HspEA
  173.     say 'Enter the H space'
  174.     parse pull theHeight
  175.     HspEA=theHeight
  176. end /*w do*/
  177.  
  178. if Command ='VS' then do
  179.     say 'VSpace='VspEA
  180.     say 'Enter the V space'
  181.     parse pull theHeight
  182.     VspEA=theHeight
  183. end /*w do*/
  184.  
  185. if Command ='ALT' then do
  186.     say 'ALT='AltEA
  187.     say 'Enter the Alternate text'
  188.     parse pull theHeight
  189.     AltEA=theHeight
  190. end /*w do*/
  191.  
  192. if Command ='AL' then do
  193.     say 'ALIGN='AliEA
  194.     say 'Choose'
  195.     say '[L]eft [R]ight [T]op [M]iddle [B]ottom'
  196.     pull theHeight
  197.     if theHeight='L' then AliEa='LEFT'
  198.     else if theHeight = 'R' then AliEa = 'RIGHT'
  199.     else if theHeight = 'T' then AliEa = 'TOP'
  200.     else if theHeight = 'M' then AliEa = 'MIDDLE'
  201.     else if theHeight = 'B' then AliEa = 'BOTTOM'
  202.     else AliEa=''
  203.  
  204. end /*w do*/
  205.  
  206. if Command ='N' then do
  207.     say 'NAME='NamEA
  208.     say 'Enter the Name'
  209.     parse pull theHeight
  210.     NamEA=theHeight
  211. end /*w do*/
  212.  
  213. say
  214. say
  215. say 'Name= 'NamEa||' Alt= 'AltEa
  216. say 'Hspace= '||HspEa||' Vspace= '||VspEa||' Align= '||AliEA' Height= '||hiEa||' Width= '||widEa
  217. say
  218. x=1
  219. do while x <= Params.0
  220.    say ' Parameter '||x||' 'Params.x
  221.    x=x+1
  222. end /* do */
  223. say
  224. say
  225. SAY 'What do you want to do next?'
  226. say '[A]dd Parameter [C]hange Parameter [D]elete Parameter [S]ave e[x]it'
  227. say 'Change the [H]eight [W]idth [HS]pace [VS]pace [N]ame [ALT]ernate text [AL]ign'
  228. PULL Command
  229. end /* do */
  230.  
  231.  
  232.