Hello, I'm trying to do a html template like in Dreamweaver, but when I copy the text from the template file using an array and make that array into a file, it comes out all screwed up.
The concept was that in the dba it would search for the key word: <!-- BeginUpdate /-->; copies everything between that key word and another which is: <!-- EndUpdate /-->; But unfortunately it gets cut off, although i think the spacing may have something to do with it, I was unable to figure it out.
The Original html file:
<! DOCTYPE HTML>
<Html>
<!-- BeginUpdate /-->
<Head>
<Title>Page Title</Title>
<Link Rel="stylesheet" Type="text/css" Href="css/layout.css">
<!-- EndUpdate /-->
<!-- BeginUpdate /-->
</Head>
<Body Link="#095960" VLink="#6f2593">
<Div id="container">
<Div id="header">
<Div id="login">
</Div>
<Div id="logo">
<A Name="top"></A>
</Div>
</Div>
<Div id="nav">
</Div>
<!-- EndUpdate /-->
<Div id="content">
<!-- BeginUpdate /-->
<Div id="sidebar">
</Div>
<!-- EndUpdate /-->
<Div id="main-cont">
</Div>
</Div>
<!-- BeginUpdate /-->
<Div id="footer">
Copyright Info<Br>
<A Href="index.html">Home</A>
<Br><A Href="#top">Back to Top</A>
</Div>
<!-- EndUpdate /-->
</Div>
</Body>
</Html>
<!-- End of Webpage /-->
The Copied and Pasted File:
<Head>
<Title>Page Title</Title>
<Link Rel="stylesheet" Type="text/css" Href="css/layout.css">
</Head>
<Div id="sidebar">
<Div id="footer">
The dba file coding:
Open to Read 1, "index.html"
Repeat
Dim CopyTemp$(c)
Read String 1, Copy$
If Lower$(Copy$)= "</html>"
Print "Out"
StopCopy= -1
Else
If Right$(Copy$, 21)= "<!-- BeginUpdate -->"
Print "In"
Repeat
Dim CopyTemp$(c, c+100)
Read String 1, Copy$
If Right$(Copy$, 19)= "<!-- EndUpdate -->"
StopCopy= 1
Else
CopyTemp$(c)= ""+Copy$
inc c
EndIf
Until StopCopy= 1
EndIf
Rem For the Npp Bug
If Right$(Copy$, 21)= "<!-- BeginUpdate /-->"
Print "In"
Repeat
Dim CopyTemp$(c, c+100)
Read String 1, Copy$
If Right$(Copy$, 19)= "<!-- EndUpdate /-->"
StopCopy= 2
Else
CopyTemp$(c)= ""+Copy$
inc c
EndIf
Until StopCopy= 2
EndIf
EndIf
Until StopCopy= -1
File$= "File.txt"
If File Exist(File$)= 1 then Delete File File$
Save Array File$, CopyTemp$()
UnDim CopyTemp$()
Close File 1
Wait Key
I'm Running Vanilla, no plugins if that helps a little...
Can anyone help my predicament?
Cyanide & Happiness 4 Ever