| Get Going With WESCL: Language Documentation | ||
|---|---|---|
| Prev | Chapter 4. Interaction between WESCL and HTML-browser | Next |
To present the state of any WESCL-register on the HTML-page, a special &IOString(regname) has to be inserted in the p-HTML-file.
Before the WebEmbed sends a HTML-page to the browser, the wescl parsing machine analyzes the user-defined "p-HTML" file, searching for &IOString(regname) placeholders and replacing them with the current value of the indicated register.
The example below shows how to place the current state of M0 and B1 register in the p-HTML file:
Example 4-2. Reading WESCL variables
<html>
<body>
<br>M0=&IOString(M0)
<br>B1=&IOString(B1)
</body>
</html> |
Note: Notice that there is a difference in appearance (on the browser screen) between the page http://webembed/wescl?V=abc.htm generated by the cgi-bin wescl, and the page http://webembed/abc.htm generated out of the plain p-HTML file (not processed by the cgi-bin wescl).
V register specifies the visualization p-HTML file, which is to be processed and sent to the browser by the cgi-bin wescl.
Example 4-3. Using V register
<html>
<body>
This is abc.html file.
</body>
</html> |
Note: After WebEmbed reset, the default value of the V register is "default.htm".
The special read-only E register contains current information about WESCL state, such as status or error description generated by the WESCL compiler.
Example 4-4. Using E register
<html>
<body>
WESCL status: &IOString(E).
</body>
</html> |
Note: If everything is ok, the default value of E register is "Working".
| Contents of the E register | Description |
|---|---|
| Working | Everything is ok. |
| ERROR: can not open /home/auto.scl file. | The auto.scl file doesn't exists. |
| ERROR: while reading /home/auto.scl file. | Read error. |
| ERROR: file /home/auto.scl is too large (>=8192 bytes). | Internal limit exceeded. |
| ERROR: Invalid Token Error | Source-code error |
| ERROR: Syntax Error | Source-code error |
| ERROR: Use simplier construction at line(...) | Too complicated expression (too many parentheses). |
| ERROR: Out of memory. Program too long. | Internal limit exceeded. |