Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: binarytag
In Webbatch I declared values for var1, var2 and so on. then I did read the html-file line by line and with Webout passed it line by line to the Brwoser. The result was, that the browser returned "%var1%", "%var2%" and so on instead of "value1", "value2" and so on.
When I copy the same lines out of the html-file and paste it to the source code, the variables are substituted correctly with their respective values.
Anything wrong?
Maybe add a few StrReplace operations between reading the line and writing the data.
If the files are BIG, I can recommend faster ways of doing it.
>> templateline = FileRead(templatefile) >> WebOut (templateline,1)Where templateline=="Text %var1% Text %var2% Text"
should produce the same output as
>> Webout ("Text %var1% Text %var2% Text",1)Yes, the template ist too big to apply 6 different StrReplace on every line.
What could be done instead of it?
You don't have to use it at all, but there is a good tutorial in there about the use of the BinaryTag functions.
With some small changes to the HTML file and the use of the various BinaryTag functions, you can easily customize vast quantities of html.
Mostly I want you to see the Html Extender help file for the tutorial on using the BinaryTag functions. You won't really use the extender in your script, but should be able to learn about how to use the BinaryTag functions to edit your html files.
Article ID: W14125
Filename: Parsing Variables to a Html-template.txt
File Created: 1999:06:09:14:33:38
Last Updated: 1999:06:09:14:33:38