I am working on some HTML code that was inherited from another programmer, which uses include statements of the form:
~inc:filename.inc~
However, the problem I am encountering is that this include statement does not work reliably. About 90% of the time, all information in the included file is imported with no problem, but every so often all of that content goes missing when I refresh the page and comes back in when I refresh again. I have already tried changing the include statements to more widely-used forms such as:
<!-- FILE="filename.inc"-->
<!-- virtual="../filename.inc"-->
<!-- virtual="/filename.inc"-->
but this only results in the file consistently not being included at all. I have been poking around other places on the Internet, but can’t seem to find any solutions or even any usage of of the ‘~inc:’ include statement.
It is worth noting that this HTML is being loaded from firmware hosted on low-power equipment and certain items on the page are updating regularly. Is it possible that the updating methods are simply running too fast for the hardware to handle?
Does anyone have any ideas for how I can solve this problem?
OK, so I downloaded the application library documentation and looked in
TCPIP Stack Help.chmand found theHTTPIncFilefunction:void HTTPIncFile(ROM BYTE* cFile);So it looks like your original syntax is the only documented one. Now, although it says not to call the function directly, since you’re having problems, it might be worth doing that to see if you get the same results.
Also note that:
This is pure speculation, but it’s possible that you might encounter issues if you try to include the file more than once, or try to include one or more files at the same time. If a file is not being included, it could be because the
callbackPoswasn’t reset. I was also assuming you aren’t trying to modify the template file, but you did say:If the files you wish to include are changing, you are probably encountering concurrency problems. You may need to resort to locking or synchronization to make sure this doesn’t happen, or try wait-spinning on the include method, checking the offset, until you successfully include a positive number of bytes.